@Service @Singleton @Named(value="mq-service") public class ActiveJmsResourceAdapter extends ActiveInboundResourceAdapterImpl implements LazyServiceInitializer, org.glassfish.hk2.api.PostConstruct
Modifier and Type | Field and Description |
---|---|
static String |
ADDRESSLIST |
static String |
ADMINPASSWORD |
static String |
ADMINUSERNAME |
static String |
BROKERTYPE |
static String |
CONNECTION_URL |
static String |
DESTINATION |
static String |
DESTINATION_TYPE |
static String |
DIRECT |
static String |
DISABLED |
static String |
EMBEDDED |
static String |
GRIZZLY_PROXY_PREFIX |
static String |
JMS_SERVICE |
static String |
LOCAL |
static String |
MQ_DIR_NAME |
static String |
PHYSICAL_DESTINATION |
static String |
REMOTE |
bootStrapContextImpl, resourceadapter_
connectionDefs_, connectorRuntime_, desc_, jcl_, moduleName_
Constructor and Description |
---|
ActiveJmsResourceAdapter()
Constructor for an active Jms Adapter.
|
Modifier and Type | Method and Description |
---|---|
void |
addJmsHost(JmsHost host)
Adds the JmsHost to the MQAddressList of the resource adapter.
|
javax.resource.spi.ManagedConnectionFactory[] |
createManagedConnectionFactories(ConnectorConnectionPool cpr,
ClassLoader loader)
This is a temporay solution for obtaining all the MCFs
corresponding to a JMS RA pool, this is to facilitate the
recovery process where the XA resources of all RMs in the
broker cluster are required.
|
javax.resource.spi.ManagedConnectionFactory |
createManagedConnectionFactory(ConnectorConnectionPool cpr,
ClassLoader loader)
Creates ManagedConnection Factory instance.
|
void |
deleteJmsHost(JmsHost host)
Removes the JmsHost from the MQAddressList of the resource adapter.
|
void |
destroy()
Destroys default pools and resources.
|
int |
getAddressListCount() |
static String |
getBrokerInstanceName(JmsService js) |
boolean |
getDoBind()
Whether JMS should bind to a port
|
Set<String> |
getGrizzlyListeners() |
protected JmsHost |
getJmsHost() |
void |
handleRequest(SelectableChannel selectableChannel)
Upon successful ACCEPT of every request on this port, the service
is called upon to handle the request.
|
boolean |
handles(ConnectorDescriptor cd,
String moduleName)
Indicates whether a particular implementation of ActiveRA can handle the RAR in question.
|
void |
initializeLazyListener(JmsService jmsService)
Start Grizzly based JMS lazy listener, which is going to initialize
JMS container on first request.
|
boolean |
initializeService()
Upon accepting the first request on the port (to which this listener is
bound), the listener will select the appropriate provider and call this
method to let the actual service initialize itself.
|
protected javax.resource.spi.ManagedConnectionFactory |
instantiateMCF(String mcfClass,
ClassLoader loader) |
protected void |
loadRAConfiguration()
Loads RA configuration for MQ Resource adapter.
|
protected Set |
mergeRAConfiguration(ResourceAdapterConfig raConfig,
List<Property> raConfigProps)
This is a HACK to remove the connection URL
in the case of PE LOCAL/EMBEDDED before setting the properties
to the RA.
|
void |
postConstruct() |
protected void |
postRAConfiguration()
Method to perform any post RA configuration action by derivative subclasses.
|
void |
reloadRA(JmsService js)
Recreates the ResourceAdapter using new values from JmsSerice.
|
protected void |
setClusterBrokerList(String brokerList) |
void |
setMasterBroker(String newMasterBroker) |
void |
setup()
Does the necessary initial setup.
|
protected void |
startResourceAdapter(javax.resource.spi.BootstrapContext bootstrapContext)
called by connector runtime to start the resource-adapter java bean
|
void |
updateJmsHost(JmsHost host)
Updates the JmsHost information in the MQAddressList of the resource adapter.
|
void |
updateMDBRuntimeInfo(EjbMessageBeanDescriptor descriptor_,
BeanPoolDescriptor poolDescriptor)
This is the most appropriate time (??) to update the runtime
info of a 1.3 MDB into 1.4 MDB.
|
void |
validateActivationSpec(javax.resource.spi.ActivationSpec spec)
validate the activation-spec
|
addEndpointFactoryInfo, getAllEndpointFactories, getAllEndpointFactoryInfo, getEndpointFactoryInfo, init, removeEndpointFactoryInfo
addAdminObject, getBootStrapContext, getResourceAdapter
createAllConnectorResources, createDefaultConnectorConnectionPools, createDefaultConnectorResources, deleteDefaultConnectorConnectionPools, deleteDefaultConnectorResources, destroyAllConnectorResources, getClassLoader, getDescriptor, getModuleName, isServer, isSystemRar
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getClassLoader, getDescriptor, getModuleName, getResourceAdapter
public static final String CONNECTION_URL
public static final String BROKERTYPE
public static final String ADMINUSERNAME
public static final String ADMINPASSWORD
public static final String DESTINATION
public static final String DESTINATION_TYPE
public static final String PHYSICAL_DESTINATION
public static final String ADDRESSLIST
public static final String JMS_SERVICE
public static final String EMBEDDED
public static final String LOCAL
public static final String REMOTE
public static final String DIRECT
public static final String DISABLED
public static final String MQ_DIR_NAME
public static final String GRIZZLY_PROXY_PREFIX
public ActiveJmsResourceAdapter()
public void postConstruct()
postConstruct
in interface org.glassfish.hk2.api.PostConstruct
protected void loadRAConfiguration() throws ConnectorRuntimeException
loadRAConfiguration
in class ActiveOutboundResourceAdapter
ConnectorRuntimeException
- in case of an exception.public void destroy()
ActiveInboundResourceAdapterImpl
destroy
in interface ActiveResourceAdapter
destroy
in class ActiveInboundResourceAdapterImpl
public void initializeLazyListener(JmsService jmsService) throws JmsInitialisationException
jmsService
- JmsInitialisationException
protected void startResourceAdapter(javax.resource.spi.BootstrapContext bootstrapContext) throws javax.resource.spi.ResourceAdapterInternalException
ActiveOutboundResourceAdapter
startResourceAdapter
in class ActiveOutboundResourceAdapter
bootstrapContext
- BootstrapContextjavax.resource.spi.ResourceAdapterInternalException
protected Set mergeRAConfiguration(ResourceAdapterConfig raConfig, List<Property> raConfigProps)
mergeRAConfiguration
in class ActiveOutboundResourceAdapter
raConfig
- resource-adapter-configraConfigProps
- resource-adapter bean configurationpublic void setup() throws ConnectorRuntimeException
ActiveOutboundResourceAdapter
setup
in interface ActiveResourceAdapter
setup
in class ActiveOutboundResourceAdapter
ConnectorRuntimeException
- If there is a failureprotected void postRAConfiguration() throws ConnectorRuntimeException
ActiveJMSResourceAdapter
to set unsupported javabean property types on its RA JavaBean runtime
instance.ConnectorRuntimeException
public static String getBrokerInstanceName(JmsService js)
public boolean handles(ConnectorDescriptor cd, String moduleName)
ActiveInboundResourceAdapterImpl
handles
in interface ActiveResourceAdapter
handles
in class ActiveInboundResourceAdapterImpl
cd
- ConnectorDescriptormoduleName
- resource adapter namepublic void validateActivationSpec(javax.resource.spi.ActivationSpec spec)
ActiveInboundResourceAdapter
validateActivationSpec
in interface ActiveInboundResourceAdapter
validateActivationSpec
in class ActiveInboundResourceAdapterImpl
spec
- activation-specpublic void reloadRA(JmsService js) throws ConnectorRuntimeException
js
- JmsService element of the domain.xmlConnectorRuntimeException
- in case of any backend error.public void addJmsHost(JmsHost host) throws ConnectorRuntimeException
host
- JmsHost element in the domain.xmlConnectorRuntimeException
- in case of any backend error.public void deleteJmsHost(JmsHost host) throws ConnectorRuntimeException
host
- JmsHost element in the domain.xmlConnectorRuntimeException
- in case of any backend error.protected JmsHost getJmsHost()
public void updateJmsHost(JmsHost host) throws ConnectorRuntimeException
host
- JmsHost element in the domain.xmlConnectorRuntimeException
- in case of any backend error.public boolean getDoBind()
public javax.resource.spi.ManagedConnectionFactory[] createManagedConnectionFactories(ConnectorConnectionPool cpr, ClassLoader loader)
createManagedConnectionFactories
in interface ActiveResourceAdapter
createManagedConnectionFactories
in class ActiveResourceAdapterImpl
cpr
- ConnectorConnectionPool
objectloader
- Class Loader.protected javax.resource.spi.ManagedConnectionFactory instantiateMCF(String mcfClass, ClassLoader loader) throws Exception
instantiateMCF
in class ActiveResourceAdapterImpl
Exception
public javax.resource.spi.ManagedConnectionFactory createManagedConnectionFactory(ConnectorConnectionPool cpr, ClassLoader loader)
createManagedConnectionFactory
in interface ActiveResourceAdapter
createManagedConnectionFactory
in class ActiveOutboundResourceAdapter
cpr
- ConnectorConnectionPool
objectloader
- Class Loader.public void updateMDBRuntimeInfo(EjbMessageBeanDescriptor descriptor_, BeanPoolDescriptor poolDescriptor) throws ConnectorRuntimeException
Assumptions :
0. Assume it is a 1.3 MDB if no RA mid is specified. 1. Use the default system JMS resource adapter.
2. The ActivationSpec of the default JMS RA will provide the setDestination, setDestinationType, setSubscriptionName methods. 3. The jndi-name of the 1.3 MDB is the value for the Destination property for the ActivationSpec. 4. The ActivationSpec provides setter methods for the properties defined in the CF that corresponds to the mdb-connection-factory JNDI name.
updateMDBRuntimeInfo
in interface ActiveInboundResourceAdapter
updateMDBRuntimeInfo
in class ActiveInboundResourceAdapterImpl
descriptor_
- poolDescriptor
- ConnectorRuntimeException
public int getAddressListCount()
public boolean initializeService()
LazyServiceInitializer
initializeService
in interface LazyServiceInitializer
public void handleRequest(SelectableChannel selectableChannel)
LazyServiceInitializer
handleRequest
in interface LazyServiceInitializer
selectableChannel
- where the incoming request was accepted.public void setMasterBroker(String newMasterBroker)
protected void setClusterBrokerList(String brokerList)
Copyright © 2019. All rights reserved.