public abstract class ConnectorFactory
extends java.lang.Object
It is used by WebSphere Message Broker to call the connector provider to change its state and request for particular types of connectors to be created. To install the connector factory in a message broker a ConnectorProviders configurable service must be created that references this class.
The ConnectorFactory is constructed when an execution group is started. The following methods are called by Message Broker to interact with the connector factory:
initialize
is called with details of the connector factory's name and properties provided on the configurable service when the execution group starts.start
is called when the first node that uses the connector is deployed.stop
is called when the last node using the connector is removed from the execution group.
Terminate
is called when the execution group is about stop.
The connection factory is also called to create connectors when nodes are deployed that need to interact with the end system.
createOutputConnector
is called when Message Broker wants to send data to the end system with out receiving any response data. Override this method to create
an OutputConnector that can interact with the end system. Leave it unimplemented if you do not which to support this interaction pattern.
createEventInputConnector
is called when Message Broker wants to receive events from an end system. Override this method to create
an EventInputConnector that can interact with the end system. Leave it unimplemented if you do not which to support this interaction pattern.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
copyright |
Constructor and Description |
---|
ConnectorFactory() |
Modifier and Type | Method and Description |
---|---|
EventInputConnector |
createEventInputConnector(java.lang.String name,
java.util.Properties sessionProps)
This is called by broker when a connector to receive data from the system is required.
|
OutputConnector |
createOutputConnector(java.lang.String name,
java.util.Properties properties)
This is called by broker when a connector to send data to the system is required.
|
java.lang.String |
getCatalogName() |
ContainerServices |
getContainerServices()
Returns a ContainerServices object which can be used by a connector writer to
obtain function and resources provided by the environment running the connector.
|
EventInputConnector[] |
getEventInputConnectors()
Returns an array of all EventInputConnectors which have been created by this factory and have not been terminated.
|
abstract java.lang.String |
getInfo()
This is called by broker to get a information about the ConnectorFactory.
|
java.lang.String |
getName()
Returns a provider name.
|
OutputConnector[] |
getOutputConnectors()
Returns an array of all OutputConnectors which have been created by this factory and have not been terminated.
|
java.util.Properties |
getProperties()
Returns a properties for this connector factory.
|
void |
initialize(java.lang.String name,
java.util.Properties properties)
This is called by broker when an execution group is started up.
|
void |
start()
This is called by broker when the first usage of the provider is about to happen.
|
void |
stop()
This is called by broker when the last connector using the provider is destroyed.
|
void |
terminate()
This is called by broker when the execution group is about to stop.
|
void |
writeActivityLog(java.lang.String messageNumber,
java.lang.String[] inserts)
Writes an entry to activity log using the context that this connector is being run in.
|
void |
writeActivityLog(java.lang.String messageNumber,
java.lang.String[] inserts,
java.util.Properties extraTags)
Writes an entry to activity log using the context that this connector is being run in.
|
public static final java.lang.String copyright
public abstract java.lang.String getInfo() throws com.ibm.broker.plugin.MbException
com.ibm.broker.plugin.MbException
- Throwing an exception will cause empty data to be used for the connector info.public void initialize(java.lang.String name, java.util.Properties properties) throws com.ibm.broker.plugin.MbException
name
- name of the connector factory as defined in the ConnectorProviders configurable serviceproperties
- the properties defined on the ConnectorProviders configurable servicecom.ibm.broker.plugin.MbException
- Throwing an exception will stop the ConnectionFactory being available for use.public void start() throws com.ibm.broker.plugin.MbException
com.ibm.broker.plugin.MbException
- Throwing an exception will fail the creation of the flow causing the start request.public OutputConnector createOutputConnector(java.lang.String name, java.util.Properties properties) throws com.ibm.broker.plugin.MbException
name
- name of the connector based on the flow and node being usedproperties
- the properties defined on the node creating the connectorcom.ibm.broker.plugin.MbException
- Throwing an exception will fail the creation of the flow requesting the connector.public EventInputConnector createEventInputConnector(java.lang.String name, java.util.Properties sessionProps) throws com.ibm.broker.plugin.MbException
name
- name of the connector based on the flow and node being usedproperties
- the properties defined on the node creating the connectorcom.ibm.broker.plugin.MbException
- Throwing an exception will fail the creation of the flow requesting the connector.public void stop() throws com.ibm.broker.plugin.MbException
com.ibm.broker.plugin.MbException
- Throwing an exception will not prevent any flows being stopped.public void terminate() throws com.ibm.broker.plugin.MbException
com.ibm.broker.plugin.MbException
- Throwing an exception will not prevent any flows being stopped.public java.lang.String getCatalogName()
com.ibm.broker.plugin.MbException
public final ContainerServices getContainerServices()
com.ibm.broker.plugin.MbException
public final java.lang.String getName() throws com.ibm.broker.plugin.MbException
com.ibm.broker.plugin.MbException
public final java.util.Properties getProperties() throws com.ibm.broker.plugin.MbException
com.ibm.broker.plugin.MbException
public final OutputConnector[] getOutputConnectors() throws com.ibm.broker.plugin.MbException
com.ibm.broker.plugin.MbException
public final EventInputConnector[] getEventInputConnectors() throws com.ibm.broker.plugin.MbException
com.ibm.broker.plugin.MbException
public final void writeActivityLog(java.lang.String messageNumber, java.lang.String[] inserts) throws com.ibm.broker.plugin.MbException
messageNumber
- message number for the catalog to use.inserts
- the inserts to include in the messagecom.ibm.broker.plugin.MbException
public final void writeActivityLog(java.lang.String messageNumber, java.lang.String[] inserts, java.util.Properties extraTags) throws com.ibm.broker.plugin.MbException
messageNumber
- message number for the catalog to use.inserts
- the inserts to include in the messageextraTags
- a map of tags to values which will be used to tag this log message.com.ibm.broker.plugin.MbException