public class JoramResourceAdapter extends Object implements ResourceAdapter, ExceptionListener, Serializable
JoramResourceAdapter
instance manages connectivities to an underlying
JORAM server: outbound connectivity (JCA connection management contract) and
inbound connectivity (asynchronous message delivery as specified by the JCA
message inflow contract).Modifier and Type | Class and Description |
---|---|
static class |
JoramResourceAdapter.Status |
Modifier and Type | Field and Description |
---|---|
private Vector<String> |
boundNames
Names of the bound objects.
|
private Hashtable<String,XAConnection> |
connections
Table holding the adapter's
XAConnection instances used for
recovering the XA resources. |
private Hashtable<ActivationSpecImpl,InboundConsumer> |
consumers
Table holding the adapter's
InboundConsumer instances,
for inbound messaging. |
protected static String |
jmxRootName
Name of the root in the MBean tree
|
protected JndiHelper |
jndiHelper
the jndi helper
|
protected String |
jndiName
the Joram resource adapter jndi name
|
static org.objectweb.util.monolog.api.Logger |
logger |
protected String |
name
the Joram resource adapter name
|
private Vector<ManagedConnectionImpl> |
producers
Vector holding the
ManagedConnectionImpl instances for
managed outbound messaging. |
private static long |
serialVersionUID
Define serialVersionUID for interoperability.
|
protected JoramResourceAdapter.Status |
status
The resource adapter status.
|
private WorkManager |
workManager
WorkManager instance provided by the application server. |
Constructor and Description |
---|
JoramResourceAdapter()
Constructs a
JoramResourceAdapter instance. |
JoramResourceAdapter(MBeanServer jmxServer)
Constructs a
JoramResourceAdapter instance. |
Modifier and Type | Method and Description |
---|---|
(package private) void |
addProducer(ManagedConnectionImpl managedCx)
Adds a given managed connection to the list of producers.
|
protected void |
bind(String name,
Object obj)
Binds an object to the JNDI context.
|
void |
createCF(String name,
ManagedConnectionFactoryImpl mcf)
Creates a non managed connection factory and binds it to JNDI.
|
String |
createQueue(String name) |
void |
createQueueCF(String name,
ManagedConnectionFactoryImpl mcf)
Creates a non managed PTP connection factory and binds it to JNDI.
|
String |
createTopic(String name) |
void |
createTopicCF(String name,
ManagedConnectionFactoryImpl mcf)
Creates a non managed PubSub connection factory and binds it to JNDI.
|
String |
createUser(String userName,
String password,
String identityClass) |
void |
endpointActivation(MessageEndpointFactory endpointFactory,
ActivationSpec spec)
Notifies the adapter to setup asynchronous message delivery for an
application server endpoint.
|
void |
endpointDeactivation(MessageEndpointFactory endpointFactory,
ActivationSpec spec)
Notifies the adapter to deactivate message delivery for a given endpoint.
|
private ConnectionFactory |
getConnectionFactory(ActivationSpecImpl specImpl) |
String |
getJMSProviderName()
Get the provider name: Joram.
|
String |
getJMSVersion()
Gets the JMS API version.
|
String |
getJndiName() |
String |
getName() |
String |
getProviderVersion()
Gets the Joram's implementation version.
|
int |
getStatus() |
String |
getStatusInfo() |
XAResource[] |
getXAResources(ActivationSpec[] specs)
Returns XA resources given an array of ActivationSpec instances.
|
void |
onException(JMSException exception) |
void |
reconnect() |
(package private) void |
removeProducer(ManagedConnectionImpl managedCx)
Removes a given managed connection from the list of producers.
|
void |
setJmxServer(MBeanServer jmxServer) |
void |
setJndiName(String jndiName) |
void |
setName(String name) |
void |
setWorkManager(WorkManager workManager) |
void |
start() |
void |
start(BootstrapContext ctx)
Initializes the adapter
|
void |
stop()
Notifies the adapter to terminate the connections it manages, and if
needed.
|
protected void |
unbind(String name)
Unbinds an object from the JNDI context.
|
private static final long serialVersionUID
public static org.objectweb.util.monolog.api.Logger logger
protected JndiHelper jndiHelper
protected JoramResourceAdapter.Status status
protected static String jmxRootName
private transient WorkManager workManager
WorkManager
instance provided by the application server.protected String name
protected String jndiName
private transient Hashtable<ActivationSpecImpl,InboundConsumer> consumers
InboundConsumer
instances,
for inbound messaging.
Key: ActivationSpec
instance
Value: InboundConsumer
instance
private transient Vector<ManagedConnectionImpl> producers
ManagedConnectionImpl
instances for
managed outbound messaging.private transient Hashtable<String,XAConnection> connections
XAConnection
instances used for
recovering the XA resources.
Key: user name
Value: XAConnection
instance
public JoramResourceAdapter()
JoramResourceAdapter
instance.public JoramResourceAdapter(MBeanServer jmxServer)
JoramResourceAdapter
instance.public int getStatus()
public String getStatusInfo()
public void setJmxServer(MBeanServer jmxServer)
public void setWorkManager(WorkManager workManager)
public String getName()
public void setName(String name)
name
- the name to setpublic String getJndiName()
public void setJndiName(String jndiName)
jndiName
- the jndiName to setpublic void start(BootstrapContext ctx) throws ResourceAdapterInternalException
start
in interface ResourceAdapter
ResourceAdapterInternalException
- If the adapter could not be
initialized.public void start() throws ResourceAdapterInternalException
ResourceAdapterInternalException
public void stop()
stop
in interface ResourceAdapter
public String createUser(String userName, String password, String identityClass) throws Exception
Exception
private ConnectionFactory getConnectionFactory(ActivationSpecImpl specImpl)
public void endpointActivation(MessageEndpointFactory endpointFactory, ActivationSpec spec) throws ResourceException
endpointActivation
in interface ResourceAdapter
IllegalStateException
- If the adapter is either not started,
or stopped.NotSupportedException
- If the provided activation parameters
are invalid.CommException
- If the JORAM server is not reachable.SecurityException
- If connecting is not allowed.ResourceException
- Generic exception.public void onException(JMSException exception)
onException
in interface ExceptionListener
public void endpointDeactivation(MessageEndpointFactory endpointFactory, ActivationSpec spec)
endpointDeactivation
in interface ResourceAdapter
public XAResource[] getXAResources(ActivationSpec[] specs) throws ResourceException
getXAResources
in interface ResourceAdapter
IllegalStateException
- If the adapter is either not started,
or stopped.NotSupportedException
- If provided activation parameters
are invalid.CommException
- If the JORAM server is not reachable.SecurityException
- If connecting is not allowed.ResourceException
- Generic exception.void addProducer(ManagedConnectionImpl managedCx)
void removeProducer(ManagedConnectionImpl managedCx)
public String getJMSVersion()
public String getJMSProviderName()
public String getProviderVersion()
protected void unbind(String name)
public void createCF(String name, ManagedConnectionFactoryImpl mcf)
name
- Name of created connection factory.public void createQueueCF(String name, ManagedConnectionFactoryImpl mcf)
name
- Name of created connection factory.public void createTopicCF(String name, ManagedConnectionFactoryImpl mcf)
name
- Name of created connection factory.Copyright © 2015 ScalAgent D.T.. All Rights Reserved.