Search in sources :

Example 6 with ActiveResourceAdapter

use of com.sun.enterprise.connectors.ActiveResourceAdapter in project Payara by payara.

the class ConnectorAdminObjectAdminServiceImpl method addAdminObject.

public void addAdminObject(String appName, String connectorName, ResourceInfo resourceInfo, String adminObjectType, String adminObjectClassName, Properties props) throws ConnectorRuntimeException {
    ActiveResourceAdapter ar = _registry.getActiveResourceAdapter(connectorName);
    if (ar == null) {
        ifSystemRarLoad(connectorName);
        ar = _registry.getActiveResourceAdapter(connectorName);
    }
    if (ar instanceof ActiveOutboundResourceAdapter) {
        ActiveOutboundResourceAdapter aor = (ActiveOutboundResourceAdapter) ar;
        aor.addAdminObject(appName, connectorName, resourceInfo, adminObjectType, adminObjectClassName, props);
    } else {
        ConnectorRuntimeException cre = new ConnectorRuntimeException("This adapter is not 1.5 compliant");
        _logger.log(Level.SEVERE, "rardeployment.non_1.5_compliant_rar", resourceInfo);
        throw cre;
    }
}
Also used : ActiveOutboundResourceAdapter(com.sun.enterprise.connectors.ActiveOutboundResourceAdapter) ConnectorRuntimeException(com.sun.appserv.connectors.internal.api.ConnectorRuntimeException) ActiveResourceAdapter(com.sun.enterprise.connectors.ActiveResourceAdapter)

Example 7 with ActiveResourceAdapter

use of com.sun.enterprise.connectors.ActiveResourceAdapter in project Payara by payara.

the class ResourceAdapterAdminServiceImpl method stopAndRemoveActiveResourceAdapter.

/**
 * Stops the resourceAdapter and removes it from connector container/
 * registry.
 *
 * @param moduleName Rarmodule name.
 * @return true it is successful stop and removal of ActiveResourceAdapter
 *         false it stop and removal fails.
 */
private boolean stopAndRemoveActiveResourceAdapter(String moduleName) {
    ActiveResourceAdapter acr = null;
    if (moduleName != null) {
        acr = _registry.getActiveResourceAdapter(moduleName);
    }
    if (acr != null) {
        sendStopToResourceAdapter(acr);
        /*
            // remove the system rar from class loader chain.
            if(ConnectorsUtil.belongsToSystemRA(moduleName)) {
                ConnectorClassFinder ccf =
                        (ConnectorClassFinder)ConnectorRegistry.getInstance().
                                getActiveResourceAdapter(moduleName).getClassLoader();
                ConnectorRuntime connectorRuntime = ConnectorRuntime.getRuntime();
                DelegatingClassLoader ccl = connectorRuntime.getConnectorClassLoader();
                boolean systemRarCLRemoved = ccl.removeDelegate(ccf);
                if(_logger.isLoggable(Level.FINE)){
                    _logger.log(Level.FINE, "System RAR [ "+moduleName+" ] removed from " +
                        "classloader chain : " + systemRarCLRemoved);
                }
            }
*/
        _registry.removeLockObject(moduleName);
        return _registry.removeActiveResourceAdapter(moduleName);
    }
    return true;
}
Also used : ActiveResourceAdapter(com.sun.enterprise.connectors.ActiveResourceAdapter)

Aggregations

ActiveResourceAdapter (com.sun.enterprise.connectors.ActiveResourceAdapter)7 ConnectorRuntimeException (com.sun.appserv.connectors.internal.api.ConnectorRuntimeException)4 ActiveOutboundResourceAdapter (com.sun.enterprise.connectors.ActiveOutboundResourceAdapter)1 ConnectorRuntime (com.sun.enterprise.connectors.ConnectorRuntime)1 ConnectorApplication (com.sun.enterprise.connectors.module.ConnectorApplication)1 Application (com.sun.enterprise.deployment.Application)1 ConnectorDescriptor (com.sun.enterprise.deployment.ConnectorDescriptor)1 PrivilegedAction (java.security.PrivilegedAction)1 NamingException (javax.naming.NamingException)1 ResourceException (javax.resource.ResourceException)1 ModuleDescriptor (org.glassfish.deployment.common.ModuleDescriptor)1