Package com.sun.enterprise.resource

Examples of com.sun.enterprise.resource.ResourceSpec


    public ResourceHandle createResource(XAResource xaResource)
         throws PoolingException {

        ResourceHandle resourceHandle = null;
        ResourceSpec spec =
                new ResourceSpec(JMS_RESOURCE_FACTORY,
                                 ResourceSpec.JMS);
       
        if (xaResource != null) {
           
            logger.logp(Level.FINEST,
View Full Code Here


        //this will clear out the HADB connection pool
        String hadbPoolname = this.getHadbJdbcConnectionPoolNameFromConfig();
        if(hadbPoolname == null) {
            return;
        }
        ResourceSpec resourceSpec = new ResourceSpec(hadbPoolname,
            ResourceSpec.JNDI_NAME);
        resourceSpec.setConnectionPoolName(hadbPoolname);
        if(resourceSpec == null) {
            return;
        }
        Switch.getSwitch().getPoolManager().emptyResourcePool(resourceSpec);
        resourceSpec = new ResourceSpec(hadbPoolname, ResourceSpec.JDBC_URL);
        resourceSpec.setConnectionPoolName(hadbPoolname);
        if(resourceSpec == null) {
            return;
        }       
        Switch.getSwitch().getPoolManager().emptyResourcePool(resourceSpec);
    }
View Full Code Here

    public ResourceHandle createResource(XAResource xaResource)
            throws PoolingException {

        ResourceHandle resourceHandle = null;
        ResourceSpec spec =
                new ResourceSpec(JMS_RESOURCE_FACTORY,
                        ResourceSpec.JMS);

        if (xaResource != null) {

            logger.logp(Level.FINEST,
View Full Code Here

        if (list.size() == 0) return;

        ResourceHandle[] handles = new ResourceHandle[list.size()];
        handles = (ResourceHandle[]) list.toArray(handles);
        for (ResourceHandle h : handles) {
            ResourceSpec spec = h.getResourceSpec();
            if (spec.isLazyAssociatable()) {
                //In this case we are assured that the managedConnection is
                //of type DissociatableManagedConnection
                javax.resource.spi.DissociatableManagedConnection mc =
                        (javax.resource.spi.DissociatableManagedConnection) h.getResource();
                if (h.isEnlisted()) {
                    getResourceManager(spec).delistResource(
                            h, XAResource.TMSUCCESS);
                }
                try {
                    mc.dissociateConnections();
                } catch (ResourceException re) {
                    InvocationException ie = new InvocationException(
                            re.getMessage());
                    ie.initCause(re);
                    throw ie;
                } finally {
                    if (h.getResourceState().isBusy()) {
                        putbackDirectToPool(h, spec.getPoolInfo());
                    }
                }
            }
        }
    }
View Full Code Here

        try {
            PoolManager poolmgr = ConnectorRuntime.getRuntime().getPoolManager();
            ConnectorRegistry registry = ConnectorRegistry.getInstance();
            PoolMetaData pmd = registry.getPoolMetaData(poolInfo);

            ResourceSpec spec = new ResourceSpec(jndiNameToUse,
                    ResourceSpec.JNDI_NAME, pmd);
            spec.setPoolInfo(this.poolInfo);
            ManagedConnectionFactory freshMCF = pmd.getMCF();

            if (getLogger().isLoggable(Level.INFO)) {
                if (!freshMCF.equals(mcf)) {
                    getLogger().info("conmgr.mcf_not_equal");
                }
            }
            ConnectorDescriptor desc = registry.getDescriptor(rarName);

            Subject subject = null;
            ClientSecurityInfo info = null;
            boolean subjectDefined = false;
            if (isUnknownAuth && rarName.equals(ConnectorConstants.DEFAULT_JMS_ADAPTER)
                    && !(pmd.isAuthCredentialsDefinedInPool())) {
                //System.out.println("Unkown Auth - pobably nonACC client");
                //Unknown authorization. This is the case for standalone java clients,
                //where the authorization is neither container nor component
                //managed. In this case we associate an non-null Subject with no
                //credentials, so that the RA can either use its own custom logic
                //for figuring out the credentials. Relevant connector spec section
                //is 9.1.8.2.
                //create non-null Subject associated with no credentials
                //System.out.println("RAR name "+ rarName);
                subject = ConnectionPoolObjectsUtils.createSubject(mcf, null);
            } else {
                if (prin == null) {
                    info = new ClientSecurityInfo(cxRequestInfo);
                } else {
                    info = new ClientSecurityInfo(prin);
                    if (prin.equals(defaultPrin)) {
                        subject = pmd.getSubject();
                    } else {
                        subject = ConnectionPoolObjectsUtils.createSubject(mcf, prin);
                    }
                }
            }

            int txLevel = pmd.getTransactionSupport();
            if (getLogger().isLoggable(Level.FINE)) {
                logFine("ConnectionMgr: poolName " + poolInfo +
                        "  txLevel : " + txLevel);
            }

             if ( conn != null ) {
                 spec.setConnectionToAssociate( conn );
             }


            return getResource(txLevel, poolmgr, mcf, spec, subject, cxRequestInfo, info, desc, shareable);
View Full Code Here

        try {
            PoolManager poolmgr = ConnectorRuntime.getRuntime().getPoolManager();
            ConnectorRegistry registry = ConnectorRegistry.getInstance();
            PoolMetaData pmd = registry.getPoolMetaData(poolInfo);

            ResourceSpec spec = new ResourceSpec(jndiNameToUse,
                    ResourceSpec.JNDI_NAME, pmd);
            spec.setPoolInfo(this.poolInfo);
            ManagedConnectionFactory freshMCF = pmd.getMCF();

            if (getLogger().isLoggable(Level.INFO)) {
                if (!freshMCF.equals(mcf)) {
                    getLogger().info("conmgr.mcf_not_equal");
                }
            }
            ConnectorDescriptor desc = registry.getDescriptor(rarName);

            Subject subject = null;
            ClientSecurityInfo info = null;
            boolean subjectDefined = false;
            if (isUnknownAuth && rarName.equals(ConnectorConstants.DEFAULT_JMS_ADAPTER)
                    && !(pmd.isAuthCredentialsDefinedInPool())) {
                //System.out.println("Unkown Auth - pobably nonACC client");
                //Unknown authorization. This is the case for standalone java clients,
                //where the authorization is neither container nor component
                //managed. In this case we associate an non-null Subject with no
                //credentials, so that the RA can either use its own custom logic
                //for figuring out the credentials. Relevant connector spec section
                //is 9.1.8.2.
                //create non-null Subject associated with no credentials
                //System.out.println("RAR name "+ rarName);
                subject = ConnectionPoolObjectsUtils.createSubject(mcf, null);
            } else {
                if (prin == null) {
                    info = new ClientSecurityInfo(cxRequestInfo);
                } else {
                    info = new ClientSecurityInfo(prin);
                    if (prin.equals(defaultPrin)) {
                        subject = pmd.getSubject();
                    } else {
                        subject = ConnectionPoolObjectsUtils.createSubject(mcf, prin);
                    }
                }
            }

            int txLevel = pmd.getTransactionSupport();
            if (getLogger().isLoggable(Level.FINE)) {
                logFine("ConnectionMgr: poolName " + poolInfo +
                        "  txLevel : " + txLevel);
            }

             if ( conn != null ) {
                 spec.setConnectionToAssociate( conn );
             }


            return getResource(txLevel, poolmgr, mcf, spec, subject, cxRequestInfo, info, desc, shareable);
View Full Code Here

        try {
            PoolManager poolmgr = ConnectorRuntime.getRuntime().getPoolManager();
            ConnectorRegistry registry = ConnectorRegistry.getInstance();
            PoolMetaData pmd = registry.getPoolMetaData(poolInfo);

            ResourceSpec spec = new ResourceSpec(jndiNameToUse,
                    ResourceSpec.JNDI_NAME, pmd);
            spec.setPoolInfo(this.poolInfo);
            ManagedConnectionFactory freshMCF = pmd.getMCF();

            if (getLogger().isLoggable(Level.INFO)) {
                if (!freshMCF.equals(mcf)) {
                    getLogger().info("conmgr.mcf_not_equal");
                }
            }
            ConnectorDescriptor desc = registry.getDescriptor(rarName);

            Subject subject = null;
            ClientSecurityInfo info = null;
            boolean subjectDefined = false;
            if (isUnknownAuth && rarName.equals(ConnectorConstants.DEFAULT_JMS_ADAPTER)
                    && !(pmd.isAuthCredentialsDefinedInPool())) {
                //System.out.println("Unkown Auth - pobably nonACC client");
                //Unknown authorization. This is the case for standalone java clients,
                //where the authorization is neither container nor component
                //managed. In this case we associate an non-null Subject with no
                //credentials, so that the RA can either use its own custom logic
                //for figuring out the credentials. Relevant connector spec section
                //is 9.1.8.2.
                //create non-null Subject associated with no credentials
                //System.out.println("RAR name "+ rarName);
                subject = ConnectionPoolObjectsUtils.createSubject(mcf, null);
            } else {
                if (prin == null) {
                    info = new ClientSecurityInfo(cxRequestInfo);
                } else {
                    info = new ClientSecurityInfo(prin);
                    if (prin.equals(defaultPrin)) {
                        subject = pmd.getSubject();
                    } else {
                        subject = ConnectionPoolObjectsUtils.createSubject(mcf, prin);
                    }
                }
            }

            int txLevel = pmd.getTransactionSupport();
            if (getLogger().isLoggable(Level.FINE)) {
                logFine("ConnectionMgr: poolName " + poolInfo +
                        "  txLevel : " + txLevel);
            }

             if ( conn != null ) {
                 spec.setConnectionToAssociate( conn );
             }


            return getResource(txLevel, poolmgr, mcf, spec, subject, cxRequestInfo, info, desc, shareable);
View Full Code Here

        if (list.size() == 0) return;

        ResourceHandle[] handles = (ResourceHandle[]) list.toArray(
                new ResourceHandle[0]);
        for (ResourceHandle h : handles) {
            ResourceSpec spec = h.getResourceSpec();
            if (spec.isLazyAssociatable()) {
                //In this case we are assured that the managedConnection is
                //of type DissociatableManagedConnection
                javax.resource.spi.DissociatableManagedConnection mc =
                        (javax.resource.spi.DissociatableManagedConnection) h.getResource();
                if (h.isEnlisted()) {
                    getResourceManager(spec).delistResource(
                            h, XAResource.TMSUCCESS);
                }
                try {
                    mc.dissociateConnections();
                } catch (ResourceException re) {
                    InvocationException ie = new InvocationException(
                            re.getMessage());
                    ie.initCause(re);
                    throw ie;
                } finally {
                    if (h.getResourceState().isBusy()) {
                        putbackDirectToPool(h, spec.getPoolInfo());
                    }
                }
            }
        }
    }
View Full Code Here

        if (list.size() == 0) return;

        ResourceHandle[] handles = (ResourceHandle[]) list.toArray(
                new ResourceHandle[0]);
        for (ResourceHandle h : handles) {
            ResourceSpec spec = h.getResourceSpec();
            if (spec.isLazyAssociatable()) {
                //In this case we are assured that the managedConnection is
                //of type DissociatableManagedConnection
                javax.resource.spi.DissociatableManagedConnection mc =
                        (javax.resource.spi.DissociatableManagedConnection) h.getResource();
                if (h.isEnlisted()) {
                    getResourceManager(spec).delistResource(
                            h, XAResource.TMSUCCESS);
                }
                try {
                    mc.dissociateConnections();
                } catch (ResourceException re) {
                    InvocationException ie = new InvocationException(
                            re.getMessage());
                    ie.initCause(re);
                    throw ie;
                } finally {
                    if (h.getResourceState().isBusy()) {
                        putbackDirectToPool(h, spec.getPoolInfo());
                    }
                }
            }
        }
    }
View Full Code Here

TOP

Related Classes of com.sun.enterprise.resource.ResourceSpec

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.