Examples of JdbcResource


Examples of com.sun.enterprise.config.serverbeans.JdbcResource

        String storePoolJndiName = this.getHaStorePoolJndiNameFromConfig();
        if(storePoolJndiName == null)
            return null;

        Resources resources = this.getResourcesBean();
        JdbcResource jdbcResource =
            resources.getJdbcResourceByJndiName(storePoolJndiName);
        if(jdbcResource == null) {
            return null;
        }
               
        String poolName = jdbcResource.getPoolName();
        JdbcConnectionPool pool =
            resources.getJdbcConnectionPoolByName(poolName);
        return pool;
    }
View Full Code Here

Examples of com.sun.enterprise.config.serverbeans.JdbcResource

        String storePoolJndiName = this.getHaStorePoolJndiNameFromConfig();
        if(storePoolJndiName == null)
            return null;

        Resources resources = this.getResourcesBean();
        JdbcResource jdbcResource =
            resources.getJdbcResourceByJndiName(storePoolJndiName);
        if(jdbcResource == null)
            return null;
        String poolName = jdbcResource.getPoolName();
        return poolName;
    }   
View Full Code Here

Examples of com.sun.enterprise.config.serverbeans.JdbcResource

               return result;
        }
       
        ConfigContext context = ccce.getConfigContext();
        Object value = ccce.getObject();
        JdbcResource jdbc = (JdbcResource)value;
        boolean isPool = false;
        String pool = jdbc.getPoolName();
       
        // check if jdbc resource jndi-name is valid object name Bug : 4698687 : start
        if(StaticTest.checkObjectName(jdbc.getJndiName(), result))
            result.passed("Valid Object Name");
        else {
            result.failed("JDBC Resource Jndi-Name Invalid ");
            return result;
        }
View Full Code Here

Examples of com.sun.enterprise.config.serverbeans.JdbcResource

     *                 This resource can either be a pmf resource or a jdbc resource
     * @return poolName of the pool that this resource directly/indirectly points to
     */
    private PoolInfo getPoolNameFromResourceJndiName(ResourceInfo resourceInfo) {
        PoolInfo poolInfo= null;
        JdbcResource jdbcResource = null;
        ResourceInfo actualResourceInfo = resourceInfo;
        String jndiName = resourceInfo.getName();

        actualResourceInfo =
                new ResourceInfo(jndiName, resourceInfo.getApplicationName(), resourceInfo.getModuleName());
        ConnectorRuntime runtime = ConnectorRuntime.getRuntime();
        jdbcResource = (JdbcResource) runtime.getResources(actualResourceInfo).getResourceByName
                (JdbcResource.class, actualResourceInfo.getName());
        if(jdbcResource == null){
            String suffix = ConnectorsUtil.getValidSuffix(jndiName);
            if(suffix != null){
                jndiName = jndiName.substring(0, jndiName.lastIndexOf(suffix));
                actualResourceInfo =
                        new ResourceInfo(jndiName, resourceInfo.getApplicationName(), resourceInfo.getModuleName());
            }
        }
        jdbcResource = (JdbcResource) runtime.getResources(actualResourceInfo).getResourceByName
                (JdbcResource.class, actualResourceInfo.getName());

        if (jdbcResource != null) {
            if (_logger.isLoggable(Level.FINE)) {
                _logger.fine("jdbcRes is ---: " + jdbcResource.getJndiName());
                _logger.fine("poolName is ---: " + jdbcResource.getPoolName());
            }
        }
        if(jdbcResource != null){
            poolInfo = new PoolInfo(jdbcResource.getPoolName(), actualResourceInfo.getApplicationName(),
                    actualResourceInfo.getModuleName());
        }
        return poolInfo;
    }                         
View Full Code Here

Examples of com.sun.enterprise.config.serverbeans.JdbcResource

        Collection<ResourceDeployer> deployers = habitat.getAllByContract(ResourceDeployer.class);
        //deploy pool
        getDeployer(jdbcCp, deployers).deployResource(jdbcCp);

        //deploy resource
        JdbcResource jdbcResource = new MyJdbcResource(poolName, resourceName);
        getDeployer(jdbcResource, deployers).deployResource(jdbcResource);
    }
View Full Code Here

Examples of com.sun.enterprise.config.serverbeans.JdbcResource

            _logger.log(Level.FINE, "DataSourceDefinitionDeployer.undeployResource() : pool-name ["+poolName+"], " +
                    " resource-name ["+resourceName+"]");
        }

        //undeploy resource
        JdbcResource jdbcResource = new MyJdbcResource(poolName, resourceName);
        getDeployer(jdbcResource, deployers).undeployResource(jdbcResource);

        //undeploy pool
        JdbcConnectionPool jdbcCp = new MyJdbcConnectionPool(desc, poolName);
        getDeployer(jdbcCp, deployers).undeployResource(jdbcCp);
View Full Code Here

Examples of com.sun.enterprise.config.serverbeans.JdbcResource

    }
    /**
     * {@inheritDoc}
     */
    public void deployResource(Object resource) throws Exception {
        JdbcResource jdbcRes = (JdbcResource) resource;
        ResourceInfo resourceInfo = ConnectorsUtil.getResourceInfo(jdbcRes);
        deployResource(jdbcRes, resourceInfo.getApplicationName(), resourceInfo.getModuleName());
    }
View Full Code Here

Examples of com.sun.enterprise.config.serverbeans.JdbcResource

    /**
     * {@inheritDoc}
     */
    public void undeployResource(Object resource, String applicationName, String moduleName) throws Exception{
        JdbcResource jdbcRes = (JdbcResource) resource;
        ResourceInfo resourceInfo = new ResourceInfo(jdbcRes.getJndiName(), applicationName, moduleName);
        deleteResource(jdbcRes, resourceInfo);
    }
View Full Code Here

Examples of com.sun.enterprise.config.serverbeans.JdbcResource

    /**
     * {@inheritDoc}
     */
    public synchronized void undeployResource(Object resource)
            throws Exception {
        JdbcResource jdbcRes = (JdbcResource) resource;
        ResourceInfo resourceInfo = ConnectorsUtil.getResourceInfo(jdbcRes);
        deleteResource(jdbcRes, resourceInfo);
    }
View Full Code Here

Examples of com.sun.enterprise.config.serverbeans.JdbcResource

     *                 This resource can either be a pmf resource or a jdbc resource
     * @return poolName of the pool that this resource directly/indirectly points to
     */
    private PoolInfo getPoolNameFromResourceJndiName(ResourceInfo resourceInfo) {
        PoolInfo poolInfo= null;
        JdbcResource jdbcResource = null;
        ResourceInfo actualResourceInfo = resourceInfo;
        String jndiName = resourceInfo.getName();

        actualResourceInfo =
                new ResourceInfo(jndiName, resourceInfo.getApplicationName(), resourceInfo.getModuleName());
        ConnectorRuntime runtime = ConnectorRuntime.getRuntime();
        jdbcResource = (JdbcResource) runtime.getResources(actualResourceInfo).getResourceByName
                (JdbcResource.class, actualResourceInfo.getName());
        if(jdbcResource == null){
            String suffix = ConnectorsUtil.getValidSuffix(jndiName);
            if(suffix != null){
                jndiName = jndiName.substring(0, jndiName.lastIndexOf(suffix));
                actualResourceInfo =
                        new ResourceInfo(jndiName, resourceInfo.getApplicationName(), resourceInfo.getModuleName());
            }
        }
        jdbcResource = (JdbcResource) runtime.getResources(actualResourceInfo).getResourceByName
                (JdbcResource.class, actualResourceInfo.getName());

        if (jdbcResource != null) {
            if (_logger.isLoggable(Level.FINE)) {
                _logger.fine("jdbcRes is ---: " + jdbcResource.getJndiName());
                _logger.fine("poolName is ---: " + jdbcResource.getPoolName());
            }
        }
        if(jdbcResource != null){
            poolInfo = new PoolInfo(jdbcResource.getPoolName(), actualResourceInfo.getApplicationName(),
                    actualResourceInfo.getModuleName());
        }
        return poolInfo;
    }                         
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.