Search in sources :

Example 11 with ResourceInfo

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

the class ManagedExecutorServiceDeployer method undeployResource.

@Override
public void undeployResource(Object resource) throws Exception {
    ManagedExecutorService managedExecutorServiceResource = (ManagedExecutorService) resource;
    ResourceInfo resourceInfo = ResourceUtil.getResourceInfo(managedExecutorServiceResource);
    undeployResource(resource, resourceInfo.getApplicationName(), resourceInfo.getModuleName());
}
Also used : ManagedExecutorService(org.glassfish.concurrent.config.ManagedExecutorService) ResourceInfo(org.glassfish.resourcebase.resources.api.ResourceInfo)

Example 12 with ResourceInfo

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

the class ManagedScheduledExecutorServiceDeployer method undeployResource.

@Override
public void undeployResource(Object resource, String applicationName, String moduleName) throws Exception {
    ManagedScheduledExecutorService managedscheduledexecutorserviceRes = (ManagedScheduledExecutorService) resource;
    ResourceInfo resourceInfo = new ResourceInfo(managedscheduledexecutorserviceRes.getJndiName(), applicationName, moduleName);
    namingService.unpublishObject(resourceInfo, managedscheduledexecutorserviceRes.getJndiName());
    // stop the runtime object
    concurrentRuntime.shutdownScheduledManagedExecutorService(managedscheduledexecutorserviceRes.getJndiName());
}
Also used : ResourceInfo(org.glassfish.resourcebase.resources.api.ResourceInfo) ManagedScheduledExecutorService(org.glassfish.concurrent.config.ManagedScheduledExecutorService)

Example 13 with ResourceInfo

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

the class ManagedThreadFactoryDeployer method deployResource.

@Override
public void deployResource(Object resource) throws Exception {
    ManagedThreadFactory ManagedThreadFactoryResource = (ManagedThreadFactory) resource;
    ResourceInfo resourceInfo = ResourceUtil.getResourceInfo(ManagedThreadFactoryResource);
    deployResource(resource, resourceInfo.getApplicationName(), resourceInfo.getModuleName());
}
Also used : ResourceInfo(org.glassfish.resourcebase.resources.api.ResourceInfo) ManagedThreadFactory(org.glassfish.concurrent.config.ManagedThreadFactory)

Example 14 with ResourceInfo

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

the class ManagedThreadFactoryDeployer method undeployResource.

@Override
public void undeployResource(Object resource, String applicationName, String moduleName) throws Exception {
    ManagedThreadFactory managedThreadFactoryRes = (ManagedThreadFactory) resource;
    ResourceInfo resourceInfo = new ResourceInfo(managedThreadFactoryRes.getJndiName(), applicationName, moduleName);
    namingService.unpublishObject(resourceInfo, managedThreadFactoryRes.getJndiName());
    // stop the runtime object
    concurrentRuntime.shutdownManagedThreadFactory(managedThreadFactoryRes.getJndiName());
}
Also used : ResourceInfo(org.glassfish.resourcebase.resources.api.ResourceInfo) ManagedThreadFactory(org.glassfish.concurrent.config.ManagedThreadFactory)

Example 15 with ResourceInfo

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

the class CustomResourceDeployer method deployResource.

/**
 * {@inheritDoc}
 */
@Override
public synchronized void deployResource(Object resource, String applicationName, String moduleName) throws Exception {
    CustomResource customResource = (CustomResource) resource;
    ResourceInfo resourceInfo = new ResourceInfo(customResource.getJndiName(), applicationName, moduleName);
    deployResource(resource, resourceInfo);
}
Also used : ResourceInfo(org.glassfish.resourcebase.resources.api.ResourceInfo) CustomResource(org.glassfish.resources.config.CustomResource)

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