@ComponentProfile(summary="A Collection of Shared Components", tag="base") public class SharedComponentList extends java.lang.Object implements ComponentLifecycle, ComponentLifecycleExtension
In the adapter configuration file this class is aliased as shared-components which is the preferred alternative to the fully qualified classname when building your configuration.
Constructor and Description |
---|
SharedComponentList() |
Modifier and Type | Method and Description |
---|---|
boolean |
addConnection(AdaptrisConnection c)
Convenience method to add a service collection performing verification.
|
java.util.Collection<AdaptrisConnection> |
addConnections(java.util.Collection<AdaptrisConnection> coll)
Convenience method to add connections performing verification.
|
boolean |
addService(Service c)
Convenience method to add a connection performing verification.
|
java.util.Collection<Service> |
addServices(java.util.Collection<Service> coll)
Convenience method to add service collections performing verification.
|
void |
bindJNDI(java.lang.String componentId)
Bind a previously added Connection to JNDI.
|
void |
close()
Closes the component.
|
boolean |
containsConnection(java.lang.String id)
Does the underlying connection list contain this id.
|
boolean |
containsService(java.lang.String id)
Does the underlying service collection list contain this id.
|
java.util.Collection<java.lang.String> |
getConnectionIds()
Return a list of connection-ids that are registered.
|
java.util.List<AdaptrisConnection> |
getConnections()
Returns a clone of the connections list.
|
java.lang.Boolean |
getDebug() |
SharedComponentLifecycleStrategy |
getLifecycleStrategy() |
java.util.Collection<java.lang.String> |
getServiceIds()
Return a list of service-ids that are registered.
|
java.util.List<Service> |
getServices()
Returns a clone of the shared-services
|
TransactionManager |
getTransactionManager() |
void |
init()
Initialises the component.
|
void |
prepare()
Prepare for initialisation.
|
java.util.Collection<AdaptrisConnection> |
removeConnection(java.lang.String id)
Remove a connection by it's ID.
|
java.util.Collection<Service> |
removeService(java.lang.String id)
Remove a service collection by it's ID.
|
void |
setConnections(java.util.List<AdaptrisConnection> l)
Set the connections.
|
void |
setDebug(java.lang.Boolean debug) |
void |
setLifecycleStrategy(SharedComponentLifecycleStrategy ls) |
void |
setServices(java.util.List<Service> serviceLists) |
void |
setTransactionManager(TransactionManager tm) |
void |
start()
Starts the component.
|
void |
stop()
Stop the component
|
public java.util.List<AdaptrisConnection> getConnections()
This method is purely to allow the underlying XML marshaller to do it's thing, you are strongly encouraged to use the
corresponding methods addConnection(AdaptrisConnection)
, addConnections(Collection)
,
removeConnection(String)
instead to manipulate the contents of the list.
public void setConnections(java.util.List<AdaptrisConnection> l)
Note that this simply calls Collection.clear()
and addConnections(Collection)
rather than setting the
underlying object directly.
l
- the list to set.java.lang.IllegalArgumentException
- if one or more connections had no unique-id, or if one or more connections would be rejected
because of duplication.public java.util.List<Service> getServices()
This method is purely to allow the underlying XML marshaller to do it's thing, you are strongly encouraged to use the
corresponding methods addService(Service)
, addServices(Collection)
, removeService(String)
instead to
manipulate the contents of the list.
public void setServices(java.util.List<Service> serviceLists)
public void init() throws CoreException
ComponentLifecycle
Component initialisation includes config verification, creation of connections etc.
init
in interface ComponentLifecycle
CoreException
- wrapping any underlying Exception
spublic void start() throws CoreException
ComponentLifecycle
Once a component is started it should be ready to process messages. In the case of AdaptrisMessageConsumer
, calling start
will begin message delivery.
start
in interface ComponentLifecycle
CoreException
- wrapping any underlying Exception
spublic void stop()
ComponentLifecycle
A stopped component is not expected to be ready to process messages. In the case of AdaptrisMessageConsumer
, calling stop
will pause message delivery. Throwing a RuntimeException
may cause unintended consequences
stop
in interface ComponentLifecycle
public void close()
ComponentLifecycle
A closed component should release any connections it uses, etc. and clean up completely. Throwing a RuntimeException
may
cause unintended consequences
close
in interface ComponentLifecycle
public void prepare() throws CoreException
ComponentLifecycleExtension
prepare
in interface ComponentLifecycleExtension
CoreException
public void bindJNDI(java.lang.String componentId) throws CoreException
When runtime additions of a connection occurs (generally via
AdapterManagerMBean.addSharedConnection(String)
), they are not automatically bound to the
internal JNDI. Use this method after adding a connection to bind the connection to JNDI.
componentId
- the connection ID of connection to bind.CoreException
- wrapping other exceptions.public java.util.Collection<java.lang.String> getConnectionIds()
public java.util.Collection<java.lang.String> getServiceIds()
public boolean addService(Service c)
c
- the connection to addjava.lang.IllegalArgumentException
- if the connection has no unique-id.public java.util.Collection<Service> addServices(java.util.Collection<Service> coll)
coll
- the service collections to addjava.lang.IllegalArgumentException
- if one or more service collections has no unique-id.public boolean addConnection(AdaptrisConnection c)
c
- the service collection to addjava.lang.IllegalArgumentException
- if the service collection has no unique-id.public java.util.Collection<AdaptrisConnection> addConnections(java.util.Collection<AdaptrisConnection> coll)
coll
- the connections to addjava.lang.IllegalArgumentException
- if one or more connections has no unique-id.public java.util.Collection<AdaptrisConnection> removeConnection(java.lang.String id)
id
- the unique-id of the connection to remove.public java.util.Collection<Service> removeService(java.lang.String id)
id
- the unique-id of the service collection to remove.public boolean containsConnection(java.lang.String id)
id
- the ID to check for.public boolean containsService(java.lang.String id)
id
- the ID to check for.public java.lang.Boolean getDebug()
public void setDebug(java.lang.Boolean debug)
public SharedComponentLifecycleStrategy getLifecycleStrategy()
public void setLifecycleStrategy(SharedComponentLifecycleStrategy ls)
public TransactionManager getTransactionManager()
public void setTransactionManager(TransactionManager tm)