@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, removeEndpointFactoryInfoaddAdminObject, getBootStrapContext, getResourceAdaptercreateAllConnectorResources, createDefaultConnectorConnectionPools, createDefaultConnectorResources, deleteDefaultConnectorConnectionPools, deleteDefaultConnectorResources, destroyAllConnectorResources, getClassLoader, getDescriptor, getModuleName, isServer, isSystemRarclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetClassLoader, getDescriptor, getModuleName, getResourceAdapterpublic 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.PostConstructprotected void loadRAConfiguration()
throws ConnectorRuntimeException
loadRAConfiguration in class ActiveOutboundResourceAdapterConnectorRuntimeException - in case of an exception.public void destroy()
ActiveInboundResourceAdapterImpldestroy in interface ActiveResourceAdapterdestroy in class ActiveInboundResourceAdapterImplpublic void initializeLazyListener(JmsService jmsService) throws JmsInitialisationException
jmsService - JmsInitialisationExceptionprotected void startResourceAdapter(javax.resource.spi.BootstrapContext bootstrapContext)
throws javax.resource.spi.ResourceAdapterInternalException
ActiveOutboundResourceAdapterstartResourceAdapter in class ActiveOutboundResourceAdapterbootstrapContext - BootstrapContextjavax.resource.spi.ResourceAdapterInternalExceptionprotected Set mergeRAConfiguration(ResourceAdapterConfig raConfig, List<Property> raConfigProps)
mergeRAConfiguration in class ActiveOutboundResourceAdapterraConfig - resource-adapter-configraConfigProps - resource-adapter bean configurationpublic void setup()
throws ConnectorRuntimeException
ActiveOutboundResourceAdaptersetup in interface ActiveResourceAdaptersetup in class ActiveOutboundResourceAdapterConnectorRuntimeException - If there is a failureprotected void postRAConfiguration()
throws ConnectorRuntimeException
ActiveJMSResourceAdapter
to set unsupported javabean property types on its RA JavaBean runtime
instance.ConnectorRuntimeExceptionpublic static String getBrokerInstanceName(JmsService js)
public boolean handles(ConnectorDescriptor cd, String moduleName)
ActiveInboundResourceAdapterImplhandles in interface ActiveResourceAdapterhandles in class ActiveInboundResourceAdapterImplcd - ConnectorDescriptormoduleName - resource adapter namepublic void validateActivationSpec(javax.resource.spi.ActivationSpec spec)
ActiveInboundResourceAdaptervalidateActivationSpec in interface ActiveInboundResourceAdaptervalidateActivationSpec in class ActiveInboundResourceAdapterImplspec - 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 ActiveResourceAdaptercreateManagedConnectionFactories in class ActiveResourceAdapterImplcpr - ConnectorConnectionPool objectloader - Class Loader.protected javax.resource.spi.ManagedConnectionFactory instantiateMCF(String mcfClass, ClassLoader loader) throws Exception
instantiateMCF in class ActiveResourceAdapterImplExceptionpublic javax.resource.spi.ManagedConnectionFactory createManagedConnectionFactory(ConnectorConnectionPool cpr, ClassLoader loader)
createManagedConnectionFactory in interface ActiveResourceAdaptercreateManagedConnectionFactory in class ActiveOutboundResourceAdaptercpr - 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 ActiveInboundResourceAdapterupdateMDBRuntimeInfo in class ActiveInboundResourceAdapterImpldescriptor_ - poolDescriptor - ConnectorRuntimeExceptionpublic int getAddressListCount()
public boolean initializeService()
LazyServiceInitializerinitializeService in interface LazyServiceInitializerpublic void handleRequest(SelectableChannel selectableChannel)
LazyServiceInitializerhandleRequest in interface LazyServiceInitializerselectableChannel - where the incoming request was accepted.public void setMasterBroker(String newMasterBroker)
protected void setClusterBrokerList(String brokerList)
Copyright © 2019. All rights reserved.