Search in sources :

Example 6 with ConnectorResource

use of org.glassfish.connectors.config.ConnectorResource in project Payara by payara.

the class ConnectionFactoryDefinitionDeployer method deployResource.

public void deployResource(Object resource) throws Exception {
    final ConnectionFactoryDefinitionDescriptor desc = (ConnectionFactoryDefinitionDescriptor) resource;
    String poolName = ConnectorsUtil.deriveResourceName(desc.getResourceId(), desc.getName(), CFDPOOL);
    String resourceName = ConnectorsUtil.deriveResourceName(desc.getResourceId(), desc.getName(), desc.getResourceType());
    if (_logger.isLoggable(Level.FINE)) {
        _logger.log(Level.FINE, "ConnectionFactoryDefinitionDeployer.deployResource() : pool-name [" + poolName + "], " + " resource-name [" + resourceName + "]");
    }
    ConnectorConnectionPool connectorCp = new MyConnectorConnectionPool(desc, poolName);
    // deploy pool
    getDeployer(connectorCp).deployResource(connectorCp);
    // deploy resource
    ConnectorResource connectorResource = new MyConnectorResource(poolName, resourceName);
    getDeployer(connectorResource).deployResource(connectorResource);
}
Also used : ConnectorConnectionPool(org.glassfish.connectors.config.ConnectorConnectionPool) ConnectionFactoryDefinitionDescriptor(com.sun.enterprise.deployment.ConnectionFactoryDefinitionDescriptor) ConnectorResource(org.glassfish.connectors.config.ConnectorResource)

Example 7 with ConnectorResource

use of org.glassfish.connectors.config.ConnectorResource 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 8 with ConnectorResource

use of org.glassfish.connectors.config.ConnectorResource 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 9 with ConnectorResource

use of org.glassfish.connectors.config.ConnectorResource 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)

Example 10 with ConnectorResource

use of org.glassfish.connectors.config.ConnectorResource in project Payara by payara.

the class JMSConnectionFactoryDefinitionDeployer method undeployResource.

public void undeployResource(Object resource) throws Exception {
    final JMSConnectionFactoryDefinitionDescriptor desc = (JMSConnectionFactoryDefinitionDescriptor) resource;
    String poolName = ConnectorsUtil.deriveResourceName(desc.getResourceId(), desc.getName(), JMSCFDDPOOL);
    String resourceName = ConnectorsUtil.deriveResourceName(desc.getResourceId(), desc.getName(), desc.getResourceType());
    if (_logger.isLoggable(Level.FINE)) {
        _logger.log(Level.FINE, "JMSConnectionFactoryDefinitionDeployer.undeployResource() : pool-name [" + poolName + "], " + " resource-name [" + resourceName + "]");
    }
    // undeploy resource
    ConnectorResource connectorResource = new MyJMSConnectionFactoryResource(poolName, resourceName);
    getDeployer(connectorResource).undeployResource(connectorResource);
    // undeploy pool
    ConnectorConnectionPool connectorCp = new MyJMSConnectionFactoryConnectionPool(desc, poolName);
    getDeployer(connectorCp).undeployResource(connectorCp);
}
Also used : JMSConnectionFactoryDefinitionDescriptor(com.sun.enterprise.deployment.JMSConnectionFactoryDefinitionDescriptor) ConnectorConnectionPool(org.glassfish.connectors.config.ConnectorConnectionPool) ConnectorResource(org.glassfish.connectors.config.ConnectorResource)

Aggregations

ConnectorResource (org.glassfish.connectors.config.ConnectorResource)18 ConnectorConnectionPool (org.glassfish.connectors.config.ConnectorConnectionPool)9 ResourceInfo (org.glassfish.resourcebase.resources.api.ResourceInfo)6 ActionReport (org.glassfish.api.ActionReport)4 ConnectorRuntimeException (com.sun.appserv.connectors.internal.api.ConnectorRuntimeException)3 Resource (com.sun.enterprise.config.serverbeans.Resource)3 Map (java.util.Map)3 PoolInfo (org.glassfish.resourcebase.resources.api.PoolInfo)3 ConnectionFactoryDefinitionDescriptor (com.sun.enterprise.deployment.ConnectionFactoryDefinitionDescriptor)2 JMSConnectionFactoryDefinitionDescriptor (com.sun.enterprise.deployment.JMSConnectionFactoryDefinitionDescriptor)2 HashMap (java.util.HashMap)2 Properties (java.util.Properties)2 NamingException (javax.naming.NamingException)2 ResourceException (javax.resource.ResourceException)2 AdminObjectResource (org.glassfish.connectors.config.AdminObjectResource)2 Property (org.jvnet.hk2.config.types.Property)2 BindableResource (com.sun.enterprise.config.serverbeans.BindableResource)1 ResourcePool (com.sun.enterprise.config.serverbeans.ResourcePool)1 Resources (com.sun.enterprise.config.serverbeans.Resources)1 ConnectorRuntime (com.sun.enterprise.connectors.ConnectorRuntime)1