Package org.glassfish.resource.common

Examples of org.glassfish.resource.common.ResourceInfo


            Resources resources = ResourcesUtil.createInstance().getResources(poolInfo);
            resourcesList = resources.getResourcesOfPool(connConnPool.getName());
        }
        for (BindableResource bindableResource : resourcesList) {

            ResourceInfo resourceInfo = ConnectorsUtil.getResourceInfo(bindableResource);
            Map<DynamicallyReconfigurableResource, Boolean> connectionFactories =
                    ConnectorRegistry.getInstance().getResourceFactories(resourceInfo);

            debug("marking connection factories for refresh");
View Full Code Here


     * {@inheritDoc}
     */
    public synchronized void deployResource(Object resource, String applicationName, String moduleName) throws Exception {
        final AdminObjectResource aor = (AdminObjectResource) resource;
        String jndiName = aor.getJndiName();
        ResourceInfo resourceInfo = new ResourceInfo(jndiName, applicationName, moduleName);
        createAdminObjectResource(aor, resourceInfo);
    }
View Full Code Here

     * {@inheritDoc}
     */
    public synchronized void deployResource(Object resource) throws Exception {

        final AdminObjectResource aor = (AdminObjectResource) resource;
        ResourceInfo resourceInfo = ConnectorsUtil.getResourceInfo(aor);
        createAdminObjectResource(aor, resourceInfo);
    }
View Full Code Here

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

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

     * given a resource config bean, returns the resource name / jndi-name
     * @param resource
     * @return resource name / jndi-name
     */
    public static ResourceInfo getGenericResourceInfo(Resource resource){
        ResourceInfo resourceInfo = null;
        String resourceName = null;
        if(resource instanceof BindableResource){
            resourceName = ((BindableResource)resource).getJndiName();
        }else if (resource instanceof ResourcePool){
            resourceName = ((ResourcePool)resource).getName();
View Full Code Here

        }
    }
    public static ResourceInfo getGenericResourceInfo(Resource resource, String resourceName){
        if(resource.getParent() != null && resource.getParent().getParent() instanceof Application){
            Application application = (Application)resource.getParent().getParent();
            return new ResourceInfo(resourceName, application.getName());
        }else if(resource.getParent() != null && resource.getParent().getParent() instanceof Module){
            Module module = (Module)resource.getParent().getParent();
            Application application = (Application)module.getParent();
            return new ResourceInfo(resourceName, application.getName(), module.getName());
        }else{
            return new ResourceInfo(resourceName);
        }
    }
View Full Code Here

    public static ResourceInfo getResourceInfo(BindableResource resource){

        if(resource.getParent() != null && resource.getParent().getParent() instanceof Application){
            Application application = (Application)resource.getParent().getParent();
            return new ResourceInfo(resource.getJndiName(), application.getName());
        }else if(resource.getParent() != null && resource.getParent().getParent() instanceof Module){
            Module module = (Module)resource.getParent().getParent();
            Application application = (Application)module.getParent();
            return new ResourceInfo(resource.getJndiName(), application.getName(), module.getName());
        }else{
            return new ResourceInfo(resource.getJndiName());
        }
    }
View Full Code Here

     * @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

Related Classes of org.glassfish.resource.common.ResourceInfo

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.