Search in sources :

Example 1 with ActiveJmsResourceAdapter

use of com.sun.enterprise.connectors.jms.system.ActiveJmsResourceAdapter in project Payara by payara.

the class JMSDestination method getMQJMXConnectorInfos.

protected MQJMXConnectorInfo[] getMQJMXConnectorInfos(final String target, final Config config, final ServerContext serverContext, final Domain domain, ConnectorRuntime connectorRuntime) throws ConnectorRuntimeException {
    try {
        final JmsService jmsService = config.getExtensionByType(JmsService.class);
        ActiveJmsResourceAdapter air = getMQAdapter(connectorRuntime);
        final Class mqRAClassName = air.getResourceAdapter().getClass();
        final CommandTarget ctarget = this.getTypeForTarget(target);
        MQJMXConnectorInfo mqjmxForServer = (MQJMXConnectorInfo) java.security.AccessController.doPrivileged(new java.security.PrivilegedExceptionAction() {

            public java.lang.Object run() throws Exception {
                if (ctarget == CommandTarget.CLUSTER || ctarget == CommandTarget.CLUSTERED_INSTANCE) {
                    if (logger.isLoggable(Level.FINE)) {
                        logger.log(Level.FINE, "Getting JMX connector for" + " cluster target " + target);
                    }
                    return _getMQJMXConnectorInfoForCluster(target, jmsService, mqRAClassName, serverContext);
                } else {
                    if (logger.isLoggable(Level.FINE)) {
                        logger.log(Level.FINE, "Getting JMX connector for" + " standalone target " + target);
                    }
                    return _getMQJMXConnectorInfo(target, jmsService, mqRAClassName, serverContext, config, domain);
                }
            }
        });
        return new MQJMXConnectorInfo[] { mqjmxForServer };
    } catch (Exception e) {
        // e.printStackTrace();
        ConnectorRuntimeException cre = new ConnectorRuntimeException(e.getMessage());
        cre.initCause(e);
        throw cre;
    }
}
Also used : ActiveJmsResourceAdapter(com.sun.enterprise.connectors.jms.system.ActiveJmsResourceAdapter) ConnectorRuntimeException(com.sun.appserv.connectors.internal.api.ConnectorRuntimeException) JmsService(com.sun.enterprise.connectors.jms.config.JmsService) CommandTarget(org.glassfish.config.support.CommandTarget) ConnectorRuntimeException(com.sun.appserv.connectors.internal.api.ConnectorRuntimeException)

Example 2 with ActiveJmsResourceAdapter

use of com.sun.enterprise.connectors.jms.system.ActiveJmsResourceAdapter in project Payara by payara.

the class JMSDestination method getMQAdapter.

/*
         *  Starts the MQ RA in the DAS, as all MQ related operations are
         *  performed in DAS.
         */
protected ActiveJmsResourceAdapter getMQAdapter(final ConnectorRuntime connectorRuntime) throws Exception {
    // Start ActiveJMSResourceAdapter.
    ActiveJmsResourceAdapter air = (ActiveJmsResourceAdapter) java.security.AccessController.doPrivileged(new java.security.PrivilegedExceptionAction() {

        public java.lang.Object run() throws Exception {
            String module = ConnectorConstants.DEFAULT_JMS_ADAPTER;
            String loc = ConnectorsUtil.getSystemModuleLocation(module);
            connectorRuntime.createActiveResourceAdapter(loc, module, null);
            return (ActiveJmsResourceAdapter) ConnectorRegistry.getInstance().getActiveResourceAdapter(module);
        }
    });
    return air;
}
Also used : ActiveJmsResourceAdapter(com.sun.enterprise.connectors.jms.system.ActiveJmsResourceAdapter)

Aggregations

ActiveJmsResourceAdapter (com.sun.enterprise.connectors.jms.system.ActiveJmsResourceAdapter)2 ConnectorRuntimeException (com.sun.appserv.connectors.internal.api.ConnectorRuntimeException)1 JmsService (com.sun.enterprise.connectors.jms.config.JmsService)1 CommandTarget (org.glassfish.config.support.CommandTarget)1