Search in sources :

Example 6 with ConnectorDescriptorInfo

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

the class ConnectorConnectionPoolDeployer method populateConnectorConnectionPool.

private void populateConnectorConnectionPool(ConnectorConnectionPool ccp, String connectionDefinitionName, String rarName, List<Property> props, List<SecurityMap> securityMaps) throws ConnectorRuntimeException {
    ConnectorDescriptor connectorDescriptor = runtime.getConnectorDescriptor(rarName);
    if (connectorDescriptor == null) {
        ConnectorRuntimeException cre = new ConnectorRuntimeException("Failed to get connection pool object");
        _logger.log(Level.SEVERE, "rardeployment.connector_descriptor_notfound_registry", rarName);
        _logger.log(Level.SEVERE, "", cre);
        throw cre;
    }
    Set connectionDefs = connectorDescriptor.getOutboundResourceAdapter().getConnectionDefs();
    ConnectionDefDescriptor cdd = null;
    Iterator it = connectionDefs.iterator();
    while (it.hasNext()) {
        cdd = (ConnectionDefDescriptor) it.next();
        if (connectionDefinitionName.equals(cdd.getConnectionFactoryIntf()))
            break;
    }
    ConnectorDescriptorInfo cdi = new ConnectorDescriptorInfo();
    cdi.setRarName(rarName);
    cdi.setResourceAdapterClassName(connectorDescriptor.getResourceAdapterClass());
    cdi.setConnectionDefinitionName(cdd.getConnectionFactoryIntf());
    cdi.setManagedConnectionFactoryClass(cdd.getManagedConnectionFactoryImpl());
    cdi.setConnectionFactoryClass(cdd.getConnectionFactoryImpl());
    cdi.setConnectionFactoryInterface(cdd.getConnectionFactoryIntf());
    cdi.setConnectionClass(cdd.getConnectionImpl());
    cdi.setConnectionInterface(cdd.getConnectionIntf());
    Properties properties = new Properties();
    // Refer Sun Bug :6579154 - Equivalent Oracle Bug :12206278
    if (rarName.trim().equals(ConnectorRuntime.DEFAULT_JMS_ADAPTER)) {
        properties.put("AddressList", "localhost");
    }
    Set mergedProps = ConnectorDDTransformUtils.mergeProps(props, cdd.getConfigProperties(), properties);
    cdi.setMCFConfigProperties(mergedProps);
    cdi.setResourceAdapterConfigProperties(connectorDescriptor.getConfigProperties());
    ccp.setConnectorDescriptorInfo(cdi);
    ccp.setSecurityMaps(SecurityMapUtils.getConnectorSecurityMaps(securityMaps));
}
Also used : ConnectorRuntimeException(com.sun.appserv.connectors.internal.api.ConnectorRuntimeException) ConnectorDescriptor(com.sun.enterprise.deployment.ConnectorDescriptor) ConnectionDefDescriptor(com.sun.enterprise.deployment.ConnectionDefDescriptor) ConnectorDescriptorInfo(com.sun.enterprise.connectors.ConnectorDescriptorInfo)

Example 7 with ConnectorDescriptorInfo

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

the class JdbcConnectionPoolDeployer method createConnectorConnectionPool.

public ConnectorConnectionPool createConnectorConnectionPool(JdbcConnectionPool adminPool, PoolInfo poolInfo) throws ConnectorRuntimeException {
    String moduleName = JdbcResourcesUtil.createInstance().getRANameofJdbcConnectionPool(adminPool);
    int txSupport = getTxSupport(moduleName);
    ConnectorDescriptor connDesc = runtime.getConnectorDescriptor(moduleName);
    // Create the connector Connection Pool object from the configbean object
    ConnectorConnectionPool conConnPool = new ConnectorConnectionPool(poolInfo);
    conConnPool.setTransactionSupport(txSupport);
    setConnectorConnectionPoolAttributes(conConnPool, adminPool);
    // Initially create the ConnectorDescriptor
    ConnectorDescriptorInfo connDescInfo = createConnectorDescriptorInfo(connDesc, moduleName);
    connDescInfo.setMCFConfigProperties(getMCFConfigProperties(adminPool, conConnPool, connDesc));
    // since we are deploying a 1.0 RAR, this is null
    connDescInfo.setResourceAdapterConfigProperties((Set) null);
    conConnPool.setConnectorDescriptorInfo(connDescInfo);
    return conConnPool;
}
Also used : ConnectorDescriptor(com.sun.enterprise.deployment.ConnectorDescriptor) ConnectorConnectionPool(com.sun.enterprise.connectors.ConnectorConnectionPool) ConnectorDescriptorInfo(com.sun.enterprise.connectors.ConnectorDescriptorInfo)

Aggregations

ConnectorDescriptorInfo (com.sun.enterprise.connectors.ConnectorDescriptorInfo)7 ConnectorConnectionPool (com.sun.enterprise.connectors.ConnectorConnectionPool)3 ConnectorRuntimeException (com.sun.appserv.connectors.internal.api.ConnectorRuntimeException)2 ConnectorDescriptor (com.sun.enterprise.deployment.ConnectorDescriptor)2 NamingException (javax.naming.NamingException)2 ConnectorNamingEvent (com.sun.appserv.connectors.internal.spi.ConnectorNamingEvent)1 ConnectorSecurityMap (com.sun.enterprise.connectors.authentication.ConnectorSecurityMap)1 RuntimeSecurityMap (com.sun.enterprise.connectors.authentication.RuntimeSecurityMap)1 ConnectionDefDescriptor (com.sun.enterprise.deployment.ConnectionDefDescriptor)1 ConnectorConfigProperty (com.sun.enterprise.deployment.ConnectorConfigProperty)1 ResourcePrincipal (com.sun.enterprise.deployment.ResourcePrincipal)1 Iterator (java.util.Iterator)1 Set (java.util.Set)1 Context (javax.naming.Context)1 RefAddr (javax.naming.RefAddr)1 StringRefAddr (javax.naming.StringRefAddr)1 PoolInfo (org.glassfish.resourcebase.resources.api.PoolInfo)1 ResourceInfo (org.glassfish.resourcebase.resources.api.ResourceInfo)1 SerializableObjectRefAddr (org.glassfish.resources.naming.SerializableObjectRefAddr)1