|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.services.binding.ServiceBindingManager
public class ServiceBindingManager
The services configuration binding manager implementation.
The ServiceBindingManager enables the centralized management of ports, by service. The port configuration store is abstracted out using the ServiceBindingStore interface.
Nested Class Summary | |
---|---|
static class |
ServiceBindingManager.BindingType
Enumeration of types of binding requests |
Constructor Summary | |
---|---|
ServiceBindingManager(String serverName,
ServiceBindingStore store)
|
Method Summary | |
---|---|
Element |
getElementBinding(String serviceName,
Element input)
Gets an Element containing the binding values for the
ServiceBinding with the given serviceName
and no binding name qualifier. |
Element |
getElementBinding(String serviceName,
String bindingName,
Element input)
Gets an Element containing the binding values for the
ServiceBinding with the given serviceName
and bindingName qualifier. |
Element |
getElementBinding(String serviceName,
String bindingName,
Element input,
String hostName,
int basePort)
Same as getElementBinding(String, String, Element) but, if no matching
service binding is found, creates a new one using the given
hostName and basePort . |
Element |
getElementBinding(String serviceName,
String bindingName,
Element input,
String hostName,
int basePort,
boolean fixedPort,
boolean fixedHostName)
Same as getElementBinding(String, String, Element) but, if no matching
service binding is found, creates a new one using the given
hostName and basePort . |
Object |
getGenericBinding(String serviceName,
Object... params)
Gets the detyped binding value for the ServiceBinding with
the given serviceName and bindingName qualifier. |
Object |
getGenericBinding(String serviceName,
String bindingName,
Object... params)
Gets the detyped binding value for the ServiceBinding with
the given serviceName and bindingName qualifier. |
InetAddress |
getInetAddressBinding(String serviceName)
Gets the InetAddress binding value for the
ServiceBinding with the given serviceName
and no binding name qualifier. |
InetAddress |
getInetAddressBinding(String serviceName,
String bindingName)
Gets the InetAddress binding value for the
ServiceBinding with the given serviceName
and bindingName qualifier. |
InetAddress |
getInetAddressBinding(String serviceName,
String bindingName,
String hostName,
int basePort)
Same as getInetAddressBinding(String, String) but, if no matching
service binding is found, creates a new one using the given
hostName and basePort . |
InetAddress |
getInetAddressBinding(String serviceName,
String bindingName,
String hostName,
int basePort,
boolean fixedPort,
boolean fixedHostName)
Same as getInetAddressBinding(String, String) but, if no matching
service binding is found, creates a new one using the given
hostName and basePort . |
int |
getIntBinding(String serviceName)
Gets the int binding value for the
ServiceBinding with the given serviceName
and no binding name qualifier. |
int |
getIntBinding(String serviceName,
String bindingName)
Gets the int binding value for the
ServiceBinding with the given serviceName
and bindingName qualifier. |
int |
getIntBinding(String serviceName,
String bindingName,
String hostName,
int basePort)
Same as getIntBinding(String, String) but, if no matching
service binding is found, creates a new one using the given
hostName and basePort . |
int |
getIntBinding(String serviceName,
String bindingName,
String hostName,
int basePort,
boolean fixedPort,
boolean fixedHostName)
Same as getIntBinding(String, String) but, if no matching
service binding is found, creates a new one using the given
hostName and basePort . |
String |
getResourceBinding(String serviceName,
String input)
Gets a filesystem path pointing to content that contains the binding values for the ServiceBinding with the given serviceName
and no binding name qualifier. |
String |
getResourceBinding(String serviceName,
String bindingName,
String input)
Gets a filesystem path pointing to content that contains the binding values for the ServiceBinding with the given serviceName
and bindingName qualifier. |
String |
getResourceBinding(String serviceName,
String bindingName,
String input,
String hostName,
int basePort)
Same as getResourceBinding(String, String, String) but, if no matching
service binding is found, creates a new one using the given
hostName and basePort . |
String |
getResourceBinding(String serviceName,
String bindingName,
String input,
String hostName,
int basePort,
boolean fixedPort,
boolean fixedHostName)
Same as getResourceBinding(String, String, String) but, if no matching
service binding is found, creates a new one using the given
hostName and basePort . |
String |
getServerName()
Gets the value of the serverName param this instance should pass
to ServiceBindingStore when
requesting bindings . |
Set<ServiceBinding> |
getServiceBindings()
|
static ServiceBindingValueSource |
getServiceBindingValueSource(ServiceBinding binding,
ServiceBindingManager.BindingType bindingType)
Algorithm for obtaining a ServiceBindingValueSource given a particular
binding and binding type. |
String |
getStringBinding(String serviceName)
Gets the String binding value for the
ServiceBinding with the given serviceName
and no binding name qualifier. |
String |
getStringBinding(String serviceName,
String input)
Gets the String binding value for the
ServiceBinding with the given serviceName
and no binding name qualifier. |
String |
getStringBinding(String serviceName,
String bindingName,
String input)
Gets the String binding value for the
ServiceBinding with the given serviceName
and bindingName qualifier. |
String |
getStringBinding(String serviceName,
String bindingName,
String input,
String hostName,
int basePort)
Same as getStringBinding(String, String, String) but, if no matching
service binding is found, creates a new one using the given
hostName and basePort . |
String |
getStringBinding(String serviceName,
String bindingName,
String input,
String hostName,
int basePort,
boolean fixedPort,
boolean fixedHostName)
Same as getStringBinding(String, String, String) but, if no matching
service binding is found, creates a new one using the given
hostName and basePort . |
URL |
getURLBinding(String serviceName,
String bindingName,
URL input)
Gets a URL pointing to content that contains the binding values
for the ServiceBinding with the given serviceName
and bindingName qualifier. |
URL |
getURLBinding(String serviceName,
String bindingName,
URL input,
String hostName,
int basePort)
Same as getURLBinding(String, String, URL) but, if no matching
service binding is found, creates a new one using the given
hostName and basePort . |
URL |
getURLBinding(String serviceName,
String bindingName,
URL input,
String hostName,
int basePort,
boolean fixedPort,
boolean fixedHostName)
Same as getURLBinding(String, String, URL) but, if no matching
service binding is found, creates a new one using the given
hostName and basePort . |
URL |
getURLBinding(String serviceName,
URL input)
Gets a URL pointing to content that contains the binding values
for the ServiceBinding with the given serviceName
and no binding name qualifier. |
void |
setServerName(String serverName)
Sets the value of the serverName param this instance should pass
to ServiceBindingStore when
requesting bindings . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ServiceBindingManager(String serverName, ServiceBindingStore store)
Method Detail |
---|
public static ServiceBindingValueSource getServiceBindingValueSource(ServiceBinding binding, ServiceBindingManager.BindingType bindingType)
ServiceBindingValueSource
given a particular
binding and binding type.
binding
- the bindingbindingType
- the binding type
ServiceBindingValueSource
. Will not return null
.
ClassNotFoundException
- if any ServiceBinding.getServiceBindingValueSourceClassName()
cannot be found
InstantiationException
- if any ServiceBinding.getServiceBindingValueSourceClassName()
cannot be instantiated
IllegalAccessException
- if any ServiceBinding.getServiceBindingValueSourceClassName()
is not public
IllegalStateException
- if no appropriate ServiceBindingValueSource can be identifiedpublic String getServerName()
serverName
param this instance should pass
to ServiceBindingStore
when
requesting bindings
.
getServerName
in interface ServiceBindingManagerMBean
public void setServerName(String serverName)
serverName
param this instance should pass
to ServiceBindingStore
when
requesting bindings
.
IllegalArgumentException
- if serverName
is null
public Set<ServiceBinding> getServiceBindings()
public int getIntBinding(String serviceName) throws NoSuchBindingException
int
binding value for the
ServiceBinding
with the given serviceName
and no binding name qualifier.
This is typically the port
.
serviceName
- value to match to ServiceBinding.getServiceName()
to identify the appropriate binding. Cannot be null
.
int
NoSuchBindingException
- if a matching ServiceBinding could not be foundIntServiceBindingValueSource
public int getIntBinding(String serviceName, String bindingName) throws NoSuchBindingException
int
binding value for the
ServiceBinding
with the given serviceName
and bindingName
qualifier.
This is typically the port
.
serviceName
- value to match to ServiceBinding.getServiceName()
to identify the appropriate binding. Cannot be null
.bindingName
- value to match to ServiceBinding.getBindingName()
to identify the appropriate binding. May be null
.
int
NoSuchBindingException
- if a matching ServiceBinding could not be foundIntServiceBindingValueSource
public int getIntBinding(String serviceName, String bindingName, String hostName, int basePort) throws UnknownHostException, DuplicateServiceException
getIntBinding(String, String)
but, if no matching
service binding is found, creates a new one using the given
hostName
and basePort
.
serviceName
- value to match to ServiceBinding.getServiceName()
to identify the appropriate binding. Cannot be null
.bindingName
- value to match to ServiceBinding.getBindingName()
to identify the appropriate binding. May be null
.hostName
- Host name to use for new service binding if one is
created.basePort
- base port to use for the binding; ServiceBindingStore
may adjust this.
int
DuplicateServiceException
- in unlikely event of concurrent attempts
to create same binding with different
binding values
UnknownHostException
- if no IP address for the hostName
could be foundpublic int getIntBinding(String serviceName, String bindingName, String hostName, int basePort, boolean fixedPort, boolean fixedHostName) throws UnknownHostException, DuplicateServiceException
getIntBinding(String, String)
but, if no matching
service binding is found, creates a new one using the given
hostName
and basePort
.
serviceName
- value to match to ServiceBinding.getServiceName()
to identify the appropriate binding. Cannot be null
.bindingName
- value to match to ServiceBinding.getBindingName()
to identify the appropriate binding. May be null
.hostName
- Host name to use for new service binding if one is
created.basePort
- base port to use for the binding; ServiceBindingStore
may adjust this.fixedPort
- whether runtime @{link ServiceBinding}s created from this
metadata can alter the port value based on the server
on which the binding is running.fixedHostName
- whether runtime @{link ServiceBinding}s created from
this metadata can alter the hostName value based on
the server on which the binding is running.
int
DuplicateServiceException
- in unlikely event of concurrent attempts
to create same binding with different
binding values
UnknownHostException
- if no IP address for the hostName
could be foundpublic InetAddress getInetAddressBinding(String serviceName) throws NoSuchBindingException
InetAddress
binding value for the
ServiceBinding
with the given serviceName
and no binding name qualifier.
This is typically the bind address
.
serviceName
- value to match to ServiceBinding.getServiceName()
to identify the appropriate binding. Cannot be null
.
NoSuchBindingException
- if a matching ServiceBinding could not be foundInetAddressServiceBindingValueSource
public InetAddress getInetAddressBinding(String serviceName, String bindingName) throws NoSuchBindingException
InetAddress
binding value for the
ServiceBinding
with the given serviceName
and bindingName
qualifier.
This is typically the bind address
.
serviceName
- value to match to ServiceBinding.getServiceName()
to identify the appropriate binding. Cannot be null
.bindingName
- value to match to ServiceBinding.getBindingName()
to identify the appropriate binding. May be null
.
NoSuchBindingException
- if a matching ServiceBinding could not be foundInetAddressServiceBindingValueSource
public InetAddress getInetAddressBinding(String serviceName, String bindingName, String hostName, int basePort) throws UnknownHostException, DuplicateServiceException
getInetAddressBinding(String, String)
but, if no matching
service binding is found, creates a new one using the given
hostName
and basePort
.
serviceName
- value to match to ServiceBinding.getServiceName()
to identify the appropriate binding. Cannot be null
.bindingName
- value to match to ServiceBinding.getBindingName()
to identify the appropriate binding. May be null
.hostName
- Host name to use for new service binding if one is
created.basePort
- base port to use for the binding; ServiceBindingStore
may adjust this.
InetAddress
DuplicateServiceException
- in unlikely event of concurrent attempts
to create same binding with different
binding values
UnknownHostException
- if no IP address for the hostName
could be foundpublic InetAddress getInetAddressBinding(String serviceName, String bindingName, String hostName, int basePort, boolean fixedPort, boolean fixedHostName) throws UnknownHostException, DuplicateServiceException
getInetAddressBinding(String, String)
but, if no matching
service binding is found, creates a new one using the given
hostName
and basePort
.
serviceName
- value to match to ServiceBinding.getServiceName()
to identify the appropriate binding. Cannot be null
.bindingName
- value to match to ServiceBinding.getBindingName()
to identify the appropriate binding. May be null
.hostName
- Host name to use for new service binding if one is
created.basePort
- base port to use for the binding; ServiceBindingStore
may adjust this.fixedPort
- whether runtime @{link ServiceBinding}s created from this
metadata can alter the port value based on the server
on which the binding is running.fixedHostName
- whether runtime @{link ServiceBinding}s created from
this metadata can alter the hostName value based on
the server on which the binding is running.
InetAddress
DuplicateServiceException
- in unlikely event of concurrent attempts
to create same binding with different
binding values
UnknownHostException
- if no IP address for the hostName
could be foundpublic String getStringBinding(String serviceName) throws NoSuchBindingException
String
binding value for the
ServiceBinding
with the given serviceName
and no binding name qualifier.
This is typically the host name
.
serviceName
- value to match to ServiceBinding.getServiceName()
to identify the appropriate binding. Cannot be null
.
NoSuchBindingException
- if a matching ServiceBinding could not be foundStringServiceBindingValueSource
public String getStringBinding(String serviceName, String input) throws NoSuchBindingException
String
binding value for the
ServiceBinding
with the given serviceName
and no binding name qualifier.
This is typically the host name
.
serviceName
- value to match to ServiceBinding.getServiceName()
to identify the appropriate binding. Cannot be null
.input
- string that should be used as a source for transformations
(e.g. string replacement), or null
if no
transformation is needed
input
.
NoSuchBindingException
- if a matching ServiceBinding could not be foundStringServiceBindingValueSource
public String getStringBinding(String serviceName, String bindingName, String input) throws NoSuchBindingException
String
binding value for the
ServiceBinding
with the given serviceName
and bindingName
qualifier.
This is typically the host name
.
serviceName
- value to match to ServiceBinding.getServiceName()
to identify the appropriate binding. Cannot be null
.bindingName
- value to match to ServiceBinding.getBindingName()
to identify the appropriate binding. May be null
.input
- string that should be used as a source for transformations
(e.g. string replacement), or null
if no
transformation is needed
input
.
NoSuchBindingException
- if a matching ServiceBinding could not be foundStringServiceBindingValueSource
public String getStringBinding(String serviceName, String bindingName, String input, String hostName, int basePort) throws UnknownHostException, DuplicateServiceException
getStringBinding(String, String, String)
but, if no matching
service binding is found, creates a new one using the given
hostName
and basePort
.
serviceName
- value to match to ServiceBinding.getServiceName()
to identify the appropriate binding. Cannot be null
.bindingName
- value to match to ServiceBinding.getBindingName()
to identify the appropriate binding. May be null
.input
- string that should be used as a source for transformations
(e.g. string replacement), or null
if no
transformation is neededhostName
- Host name to use for new service binding if one is
created.basePort
- base port to use for the binding; ServiceBindingStore
may adjust this.
input
.
DuplicateServiceException
- in unlikely event of concurrent attempts
to create same binding with different
binding values
UnknownHostException
- if no IP address for the hostName
could be foundpublic String getStringBinding(String serviceName, String bindingName, String input, String hostName, int basePort, boolean fixedPort, boolean fixedHostName) throws UnknownHostException, DuplicateServiceException
getStringBinding(String, String, String)
but, if no matching
service binding is found, creates a new one using the given
hostName
and basePort
.
serviceName
- value to match to ServiceBinding.getServiceName()
to identify the appropriate binding. Cannot be null
.bindingName
- value to match to ServiceBinding.getBindingName()
to identify the appropriate binding. May be null
.input
- string that should be used as a source for transformations
(e.g. string replacement), or null
if no
transformation is neededhostName
- Host name to use for new service binding if one is
created.basePort
- base port to use for the binding; ServiceBindingStore
may adjust this.fixedPort
- whether runtime @{link ServiceBinding}s created from this
metadata can alter the port value based on the server
on which the binding is running.fixedHostName
- whether runtime @{link ServiceBinding}s created from
this metadata can alter the hostName value based on
the server on which the binding is running.
input
.
DuplicateServiceException
- in unlikely event of concurrent attempts
to create same binding with different
binding values
UnknownHostException
- if no IP address for the hostName
could be foundpublic Element getElementBinding(String serviceName, Element input) throws NoSuchBindingException
Element
containing the binding values for the
ServiceBinding
with the given serviceName
and no binding name qualifier.
Used to perform transformations on values embedded in DOM elements.
serviceName
- value to match to ServiceBinding.getServiceName()
to identify the appropriate binding. Cannot be null
.input
- element that should be used as a source for transformations
input
.
NoSuchBindingException
- if a matching ServiceBinding could not be foundElementServiceBindingValueSource
public Element getElementBinding(String serviceName, String bindingName, Element input) throws NoSuchBindingException
Element
containing the binding values for the
ServiceBinding
with the given serviceName
and bindingName
qualifier.
Used to perform transformations on values embedded in DOM elements.
serviceName
- value to match to ServiceBinding.getServiceName()
to identify the appropriate binding. Cannot be null
.bindingName
- value to match to ServiceBinding.getBindingName()
to identify the appropriate binding. May be null
.input
- element that should be used as a source for transformations
input
.
NoSuchBindingException
- if a matching ServiceBinding could not be foundElementServiceBindingValueSource
public Element getElementBinding(String serviceName, String bindingName, Element input, String hostName, int basePort) throws UnknownHostException, DuplicateServiceException
getElementBinding(String, String, Element)
but, if no matching
service binding is found, creates a new one using the given
hostName
and basePort
.
serviceName
- value to match to ServiceBinding.getServiceName()
to identify the appropriate binding. Cannot be null
.bindingName
- value to match to ServiceBinding.getBindingName()
to identify the appropriate binding. May be null
.input
- string that should be used as a source for transformations
(e.g. string replacement), or null
if no
transformation is neededhostName
- Host name to use for new service binding if one is
created.basePort
- base port to use for the binding; ServiceBindingStore
may adjust this.
input
.
DuplicateServiceException
- in unlikely event of concurrent attempts
to create same binding with different
binding values
UnknownHostException
- if no IP address for the hostName
could be foundpublic Element getElementBinding(String serviceName, String bindingName, Element input, String hostName, int basePort, boolean fixedPort, boolean fixedHostName) throws UnknownHostException, DuplicateServiceException
getElementBinding(String, String, Element)
but, if no matching
service binding is found, creates a new one using the given
hostName
and basePort
.
serviceName
- value to match to ServiceBinding.getServiceName()
to identify the appropriate binding. Cannot be null
.bindingName
- value to match to ServiceBinding.getBindingName()
to identify the appropriate binding. May be null
.input
- string that should be used as a source for transformations
(e.g. string replacement), or null
if no
transformation is neededhostName
- Host name to use for new service binding if one is
created.basePort
- base port to use for the binding; ServiceBindingStore
may adjust this.fixedPort
- whether runtime @{link ServiceBinding}s created from this
metadata can alter the port value based on the server
on which the binding is running.fixedHostName
- whether runtime @{link ServiceBinding}s created from
this metadata can alter the hostName value based on
the server on which the binding is running.
input
.
DuplicateServiceException
- in unlikely event of concurrent attempts
to create same binding with different
binding values
UnknownHostException
- if no IP address for the hostName
could be foundpublic URL getURLBinding(String serviceName, URL input) throws NoSuchBindingException
URL
pointing to content that contains the binding values
for the ServiceBinding
with the given serviceName
and no binding name qualifier.
Typical usage is in file transformation operations, where the content
of the given input
URL is read, transformed, written to a
temp file, and the URL of the temp file returned.
serviceName
- value to match to ServiceBinding.getServiceName()
to identify the appropriate binding. Cannot be null
.input
- URL of content that should be used as a source for transformations
NoSuchBindingException
- if a matching ServiceBinding could not be foundURLServiceBindingValueSource
public URL getURLBinding(String serviceName, String bindingName, URL input) throws NoSuchBindingException
URL
pointing to content that contains the binding values
for the ServiceBinding
with the given serviceName
and bindingName
qualifier.
Typical usage is in file transformation operations, where the content
of the given input
URL is read, transformed, written to a
temp file, and the URL of the temp file returned.
serviceName
- value to match to ServiceBinding.getServiceName()
to identify the appropriate binding. Cannot be null
.bindingName
- value to match to ServiceBinding.getBindingName()
to identify the appropriate binding. May be null
.input
- URL of content that should be used as a source for transformations
NoSuchBindingException
- if a matching ServiceBinding could not be foundURLServiceBindingValueSource
public URL getURLBinding(String serviceName, String bindingName, URL input, String hostName, int basePort) throws UnknownHostException, DuplicateServiceException
getURLBinding(String, String, URL)
but, if no matching
service binding is found, creates a new one using the given
hostName
and basePort
.
serviceName
- value to match to ServiceBinding.getServiceName()
to identify the appropriate binding. Cannot be null
.bindingName
- value to match to ServiceBinding.getBindingName()
to identify the appropriate binding. May be null
.input
- string that should be used as a source for transformations
(e.g. string replacement), or null
if no
transformation is neededhostName
- Host name to use for new service binding if one is
created.basePort
- base port to use for the binding; ServiceBindingStore
may adjust this.
DuplicateServiceException
- in unlikely event of concurrent attempts
to create same binding with different
binding values
UnknownHostException
- if no IP address for the hostName
could be foundpublic URL getURLBinding(String serviceName, String bindingName, URL input, String hostName, int basePort, boolean fixedPort, boolean fixedHostName) throws UnknownHostException, DuplicateServiceException
getURLBinding(String, String, URL)
but, if no matching
service binding is found, creates a new one using the given
hostName
and basePort
.
serviceName
- value to match to ServiceBinding.getServiceName()
to identify the appropriate binding. Cannot be null
.bindingName
- value to match to ServiceBinding.getBindingName()
to identify the appropriate binding. May be null
.input
- string that should be used as a source for transformations
(e.g. string replacement), or null
if no
transformation is neededhostName
- Host name to use for new service binding if one is
created.basePort
- base port to use for the binding; ServiceBindingStore
may adjust this.fixedPort
- whether runtime @{link ServiceBinding}s created from this
metadata can alter the port value based on the server
on which the binding is running.fixedHostName
- whether runtime @{link ServiceBinding}s created from
this metadata can alter the hostName value based on
the server on which the binding is running.
DuplicateServiceException
- in unlikely event of concurrent attempts
to create same binding with different
binding values
UnknownHostException
- if no IP address for the hostName
could be foundpublic String getResourceBinding(String serviceName, String input) throws NoSuchBindingException
ServiceBinding
with the given serviceName
and no binding name qualifier.
Typical usage is in file transformation operations, where the content
of the given input
classpath resource is read, transformed, written to a
temp file, and the filesystem path of the temp file returned.
serviceName
- value to match to ServiceBinding.getServiceName()
to identify the appropriate binding. Cannot be null
.input
- location of content that should be used as a source for transformations;
either a String representation of a URL or a value that
can be passed to ClassLoader.getResourceAsStream(String)
.
Cannot be null
.
null
.
NoSuchBindingException
- if a matching ServiceBinding could not be foundURLServiceBindingValueSource
public String getResourceBinding(String serviceName, String bindingName, String input) throws NoSuchBindingException
ServiceBinding
with the given serviceName
and bindingName
qualifier.
Typical usage is in file transformation operations, where the content
of the given input
classpath resource is read, transformed, written to a
temp file, and the filesystem path of the temp file returned.
serviceName
- value to match to ServiceBinding.getServiceName()
to identify the appropriate binding. Cannot be null
.bindingName
- value to match to ServiceBinding.getBindingName()
to identify the appropriate binding. May be null
.input
- location of content that should be used as a source for transformations;
either a String representation of a URL or a value that
can be passed to ClassLoader.getResourceAsStream(String)
.
Cannot be null
.
null
.
NoSuchBindingException
- if a matching ServiceBinding could not be foundURLServiceBindingValueSource
public String getResourceBinding(String serviceName, String bindingName, String input, String hostName, int basePort) throws UnknownHostException, DuplicateServiceException
getResourceBinding(String, String, String)
but, if no matching
service binding is found, creates a new one using the given
hostName
and basePort
.
serviceName
- value to match to ServiceBinding.getServiceName()
to identify the appropriate binding. Cannot be null
.bindingName
- value to match to ServiceBinding.getBindingName()
to identify the appropriate binding. May be null
.input
- string that should be used as a source for transformations
(e.g. string replacement), or null
if no
transformation is neededhostName
- Host name to use for new service binding if one is
created.basePort
- base port to use for the binding; ServiceBindingStore
may adjust this.
null
.
DuplicateServiceException
- in unlikely event of concurrent attempts
to create same binding with different
binding values
UnknownHostException
- if no IP address for the hostName
could be foundpublic String getResourceBinding(String serviceName, String bindingName, String input, String hostName, int basePort, boolean fixedPort, boolean fixedHostName) throws UnknownHostException, DuplicateServiceException
getResourceBinding(String, String, String)
but, if no matching
service binding is found, creates a new one using the given
hostName
and basePort
.
serviceName
- value to match to ServiceBinding.getServiceName()
to identify the appropriate binding. Cannot be null
.bindingName
- value to match to ServiceBinding.getBindingName()
to identify the appropriate binding. May be null
.input
- string that should be used as a source for transformations
(e.g. string replacement), or null
if no
transformation is neededhostName
- Host name to use for new service binding if one is
created.basePort
- base port to use for the binding; ServiceBindingStore
may adjust this.fixedPort
- whether runtime @{link ServiceBinding}s created from this
metadata can alter the port value based on the server
on which the binding is running.fixedHostName
- whether runtime @{link ServiceBinding}s created from
this metadata can alter the hostName value based on
the server on which the binding is running.
null
.
DuplicateServiceException
- in unlikely event of concurrent attempts
to create same binding with different
binding values
UnknownHostException
- if no IP address for the hostName
could be foundpublic Object getGenericBinding(String serviceName, Object... params) throws NoSuchBindingException
ServiceBinding
with
the given serviceName
and bindingName
qualifier.
This method is an extension point to allow integration of custom
ServiceBindingValueSource
implementations.
serviceName
- value to match to ServiceBinding.getServiceName()
to identify the appropriate binding. Cannot be null
.params
- arbitrary parameters understood by the @{link ServiceBindingValueSource
associated with the binding.
NoSuchBindingException
- if a matching ServiceBinding could not be foundServiceBinding.getServiceBindingValueSource()
public Object getGenericBinding(String serviceName, String bindingName, Object... params) throws NoSuchBindingException
ServiceBinding
with
the given serviceName
and bindingName
qualifier.
This method is an extension point to allow integration of custom
ServiceBindingValueSource
implementations.
serviceName
- value to match to ServiceBinding.getServiceName()
to identify the appropriate binding. Cannot be null
.bindingName
- value to match to ServiceBinding.getBindingName()
to identify the appropriate binding. May be null
.params
- arbitrary parameters understood by the @{link ServiceBindingValueSource
associated with the binding.
NoSuchBindingException
- if a matching ServiceBinding could not be foundServiceBinding.getServiceBindingValueSource()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |