|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.services.binding.impl.PojoServiceBindingStore
public class PojoServiceBindingStore
A Pojo implementation of ServiceBindingStore
.
Constructor Summary | |
---|---|
PojoServiceBindingStore()
Creates a new PojoServiceBindingStore |
|
PojoServiceBindingStore(Set<ServiceBindingSet> bindingSets,
Set<ServiceBindingMetadata> standardBindings)
|
Method Summary | |
---|---|
void |
addServiceBinding(ServiceBindingMetadata metadata)
Add a ServiceBinding to all binding sets in the store. |
void |
addServiceBinding(String serverName,
ServiceBindingMetadata metadata)
Add a ServiceBinding to the store for the given serverName. |
void |
addServiceBinding(String serviceName,
String bindingName,
String hostName,
int port,
boolean fixedPort)
Creates a new ServiceBindingMetadata from the given params
and calls addServiceBinding(ServiceBindingMetadata) . |
void |
addServiceBinding(String serviceName,
String bindingName,
String description,
String hostName,
int port,
boolean fixedHostName,
boolean fixedPort)
Creates a new ServiceBindingMetadata from the given params
and calls addServiceBinding(ServiceBindingMetadata) . |
Set<ServiceBindingSet> |
getBindingSets()
Deprecated. use getServiceBindingSets() |
String |
getDefaultHostName(String serverName)
Gets the default value to use as the host name for the given serverName. |
int |
getDefaultPortOffset(String serverName)
Gets the offset from a base value that by default should be added to port values for a given serverName. |
ServiceBinding |
getServiceBinding(String serverName,
String serviceName,
String bindingName)
Obtain a ServiceBinding object for the given server name, target service and binding name. |
Set<ServiceBinding> |
getServiceBindings(String serverName)
Gets all service bindings for the given server name. |
Set<ServiceBindingSet> |
getServiceBindingSets()
Gets the ServiceBindingSet s associated with this store. |
Set<ServiceBindingMetadata> |
getStandardBindings()
Gets the base set of bindings that should be associated with each binding set, but with that binding set's port offset
applied to the port value. |
void |
removeServiceBinding(ServiceBindingMetadata metadata)
Remove a service configuration from all binding sets in the store. |
void |
removeServiceBinding(String serverName,
ServiceBindingMetadata metadata)
Remove a ServiceBinding from the store for the given serverName. |
void |
removeServiceBinding(String serviceName,
String bindingName)
Remove a service configuration from all binding sets in the store. |
void |
setServiceBindingSets(Set<ServiceBindingSet> sets)
|
void |
setStandardBindings(Set<ServiceBindingMetadata> bindings)
Sets the base set of bindings that should be associated with each binding set, adjusted to conform to the binding set's defaultHostName and offset. |
void |
start()
Builds the runtime sets of bindings from the injected base bindings and ServiceBindingSets. |
void |
stop()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PojoServiceBindingStore()
public PojoServiceBindingStore(Set<ServiceBindingSet> bindingSets, Set<ServiceBindingMetadata> standardBindings)
Method Detail |
---|
public void addServiceBinding(String serverName, ServiceBindingMetadata metadata) throws DuplicateServiceException, UnknownHostException
ServiceBindingStore
addServiceBinding
in interface ServiceBindingStore
serverName
- the name identifying the JBoss server instance in
which the service is running.metadata
- metadata for the binding to add
DuplicateServiceException
- thrown if a configuration for the
UnknownHostException
- if the host specified by the metadata is unknownpublic ServiceBinding getServiceBinding(String serverName, String serviceName, String bindingName) throws NoSuchBindingException
ServiceBindingStore
getServiceBinding
in interface ServiceBindingStore
serverName
- the name identifying the server instance
in which the service is running.serviceName
- the name of the servicebindingName
- the name of the binding, or null
to indicate
the default binding.
NoSuchBindingException
- if no matching binding existspublic Set<ServiceBinding> getServiceBindings(String serverName)
ServiceBindingStore
getServiceBindings
in interface ServiceBindingStore
serverName
- the name identifying the server instance
in which the service is running. Cannot be null
.
public void removeServiceBinding(String serverName, ServiceBindingMetadata metadata)
ServiceBindingStore
removeServiceBinding
in interface ServiceBindingStore
serverName
- the name identifying the JBoss server instance in
which the service is running.metadata
- the bindingpublic String getDefaultHostName(String serverName)
ServiceBindingStore
getDefaultHostName
in interface ServiceBindingStore
serverName
- the name of the binding set
public int getDefaultPortOffset(String serverName)
ServiceBindingStore
getDefaultPortOffset
in interface ServiceBindingStore
serverName
- the name of the binding set
public void setStandardBindings(Set<ServiceBindingMetadata> bindings) throws UnknownHostException, DuplicateServiceException
bindings
- the set of base bindings. May be null
DuplicateServiceException
UnknownHostException
IllegalStateException
- if invoked after start()
public void setServiceBindingSets(Set<ServiceBindingSet> sets) throws UnknownHostException, DuplicateServiceException
UnknownHostException
DuplicateServiceException
public void start() throws DuplicateServiceException, UnknownHostException
DuplicateServiceException
UnknownHostException
public void stop()
public Set<ServiceBindingMetadata> getStandardBindings()
port offset
applied to the port value.
public Set<ServiceBindingSet> getBindingSets()
getServiceBindingSets()
getServiceBindingSets()
public Set<ServiceBindingSet> getServiceBindingSets()
ServiceBindingSet
s associated with this store.
null
public void addServiceBinding(ServiceBindingMetadata metadata) throws DuplicateServiceException
fixeHostName
property is false
, the new binding's
hostName matches the target set's default host name
.
If binding
's fixedPort
property is false
,
the new binding's port is derived by taking the port from the passed binding
and incrementing it by the target set's
default port offset
.
metadata
- metadata about the binding to add
DuplicateServiceException
- thrown if a configuration for the
public void addServiceBinding(String serviceName, String bindingName, String hostName, int port, boolean fixedPort) throws DuplicateServiceException, UnknownHostException
ServiceBindingMetadata
from the given params
and calls addServiceBinding(ServiceBindingMetadata)
.
serviceName
- the name of the service. Cannot be null
bindingName
- name qualifier for the binding within the service.
May be null
hostName
- hostname or IP address to which the binding should be
bound. Use null
to indicate the host name
should be the default host name for each binding setserviceConfig
- the configuration to addfixed
- true
if the binding's port should remain fixed
when added to each binding set; false
if it
should be offset by the binding set's port offset
DuplicateServiceException
- thrown if a configuration for the
UnknownHostException
public void addServiceBinding(String serviceName, String bindingName, String description, String hostName, int port, boolean fixedHostName, boolean fixedPort) throws DuplicateServiceException, UnknownHostException
ServiceBindingMetadata
from the given params
and calls addServiceBinding(ServiceBindingMetadata)
.
serviceName
- the name of the service. Cannot be null
bindingName
- name qualifier for the binding within the service.
May be null
description
- helpful description of the binding; may be null
hostName
- hostname or IP address to which the binding should be
bound. Often null
since the host name typically
comes from the default host name for each binding setport
- port the binding should usefixedHostName
- true
if the binding's hostName
should remain fixed when added to each binding set;
false
if it should be changed to the binding set's
default host namefixedPort
- true
if the binding's port should remain fixed
when added to each binding set; false
if it
should be offset by the binding set's port offset
DuplicateServiceException
- thrown if a configuration for the
UnknownHostException
public void removeServiceBinding(ServiceBindingMetadata metadata)
metadata
- the bindingpublic void removeServiceBinding(String serviceName, String bindingName)
serviceName
- the name of the service. Cannot be null
bindingName
- name qualifier for the binding within the service.
May be null
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |