Search in sources :

Example 31 with ResourceInfo

use of org.glassfish.resourcebase.resources.api.ResourceInfo in project Payara by payara.

the class AdminObjectResourceDeployer method undeployResource.

/**
 * {@inheritDoc}
 */
public void undeployResource(Object resource, String applicationName, String moduleName) throws Exception {
    final AdminObjectResource aor = (AdminObjectResource) resource;
    ResourceInfo resourceInfo = new ResourceInfo(aor.getJndiName(), applicationName, moduleName);
    deleteAdminObjectResource(aor, resourceInfo);
}
Also used : ResourceInfo(org.glassfish.resourcebase.resources.api.ResourceInfo) AdminObjectResource(org.glassfish.connectors.config.AdminObjectResource)

Example 32 with ResourceInfo

use of org.glassfish.resourcebase.resources.api.ResourceInfo in project Payara by payara.

the class ConnectorResourceDeployer method deleteConnectorResource.

private void deleteConnectorResource(ConnectorResource connectorResource, ResourceInfo resourceInfo) throws Exception {
    runtime.deleteConnectorResource(resourceInfo);
    // In-case the resource is explicitly created with a suffix (__nontx or __PM), no need to delete one
    if (ConnectorsUtil.getValidSuffix(resourceInfo.getName()) == null) {
        String pmJndiName = ConnectorsUtil.getPMJndiName(resourceInfo.getName());
        ResourceInfo pmResourceInfo = new ResourceInfo(pmJndiName, resourceInfo.getApplicationName(), resourceInfo.getModuleName());
        runtime.deleteConnectorResource(pmResourceInfo);
    }
    // Since 8.1 PE/SE/EE - if no more resource-ref to the pool
    // of this resource in this server instance, remove pool from connector
    // runtime
    checkAndDeletePool(connectorResource);
}
Also used : ResourceInfo(org.glassfish.resourcebase.resources.api.ResourceInfo)

Example 33 with ResourceInfo

use of org.glassfish.resourcebase.resources.api.ResourceInfo in project Payara by payara.

the class ConnectorResourceDeployer method deployResource.

/**
 * {@inheritDoc}
 */
public void deployResource(Object resource) throws Exception {
    // deployResource is not synchronized as there is only one caller
    // ResourceProxy which is synchronized
    ConnectorResource domainResource = (ConnectorResource) resource;
    String poolName = domainResource.getPoolName();
    ResourceInfo resourceInfo = ConnectorsUtil.getResourceInfo(domainResource);
    PoolInfo poolInfo = new PoolInfo(poolName, resourceInfo.getApplicationName(), resourceInfo.getModuleName());
    createConnectorResource(domainResource, resourceInfo, poolInfo);
}
Also used : ResourceInfo(org.glassfish.resourcebase.resources.api.ResourceInfo) PoolInfo(org.glassfish.resourcebase.resources.api.PoolInfo) ConnectorResource(org.glassfish.connectors.config.ConnectorResource)

Example 34 with ResourceInfo

use of org.glassfish.resourcebase.resources.api.ResourceInfo in project Payara by payara.

the class ConnectorResourceDeployer method undeployResource.

/**
 * {@inheritDoc}
 */
public void undeployResource(Object resource, String applicationName, String moduleName) throws Exception {
    ConnectorResource domainResource = (ConnectorResource) resource;
    ResourceInfo resourceInfo = new ResourceInfo(domainResource.getJndiName(), applicationName, moduleName);
    deleteConnectorResource(domainResource, resourceInfo);
}
Also used : ResourceInfo(org.glassfish.resourcebase.resources.api.ResourceInfo) ConnectorResource(org.glassfish.connectors.config.ConnectorResource)

Example 35 with ResourceInfo

use of org.glassfish.resourcebase.resources.api.ResourceInfo in project Payara by payara.

the class ConnectorResourceDeployer method undeployResource.

/**
 * {@inheritDoc}
 */
public synchronized void undeployResource(Object resource) throws Exception {
    ConnectorResource domainResource = (ConnectorResource) resource;
    ResourceInfo resourceInfo = ConnectorsUtil.getResourceInfo(domainResource);
    deleteConnectorResource(domainResource, resourceInfo);
}
Also used : ResourceInfo(org.glassfish.resourcebase.resources.api.ResourceInfo) ConnectorResource(org.glassfish.connectors.config.ConnectorResource)

Aggregations

ResourceInfo (org.glassfish.resourcebase.resources.api.ResourceInfo)81 PoolInfo (org.glassfish.resourcebase.resources.api.PoolInfo)15 NamingException (javax.naming.NamingException)14 JdbcResource (org.glassfish.jdbc.config.JdbcResource)9 Test (org.junit.Test)9 ContextServiceImpl (org.glassfish.enterprise.concurrent.ContextServiceImpl)8 ConnectorRuntimeException (com.sun.appserv.connectors.internal.api.ConnectorRuntimeException)7 ConnectorResource (org.glassfish.connectors.config.ConnectorResource)6 RefAddr (javax.naming.RefAddr)5 SerializableObjectRefAddr (org.glassfish.resources.naming.SerializableObjectRefAddr)5 Resources (com.sun.enterprise.config.serverbeans.Resources)4 ResourceException (javax.resource.ResourceException)4 ContextService (org.glassfish.concurrent.config.ContextService)4 ManagedThreadFactory (org.glassfish.concurrent.config.ManagedThreadFactory)4 AdminObjectResource (org.glassfish.connectors.config.AdminObjectResource)4 CustomResource (org.glassfish.resources.config.CustomResource)4 MailResource (org.glassfish.resources.javamail.config.MailResource)4 ManagedConnectionFactory (javax.resource.spi.ManagedConnectionFactory)3 ManagedExecutorService (org.glassfish.concurrent.config.ManagedExecutorService)3 ManagedScheduledExecutorService (org.glassfish.concurrent.config.ManagedScheduledExecutorService)3