Package org.glassfish.resourcebase.resources.api

Examples of org.glassfish.resourcebase.resources.api.ResourceInfo


     * 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 = resource.getIdentity();
        resourceInfo = getGenericResourceInfo(resource, resourceName);
        return resourceInfo;
    }
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

            }

            if(dsdName.startsWith(ConnectorConstants.JAVA_GLOBAL_SCOPE_PREFIX)
                    /*|| next.getName().startsWith("java:module/")*/
                    || dsdName.startsWith(ConnectorConstants.JAVA_APP_SCOPE_PREFIX)){
                ResourceInfo resourceInfo = new ResourceInfo(dsdName, appName, null);
                try {
                    resourceNamingService.publishObject(resourceInfo, proxy, true);
                    dsd.setDeployed(true);
                } catch (NamingException e) {
                    Object params[] = new Object[]{appName, dsdName, e};
View Full Code Here

        }
        return enabled;
    }

    public boolean isEnabled(BindableResource br) {
        ResourceInfo resourceInfo = ConnectorsUtil.getResourceInfo(br);
        return isEnabled(br, resourceInfo);
    }
View Full Code Here

                getResources(ConnectorResource.class);
        for (ConnectorResource resource : connectorResources) {
            if(_logger.isLoggable(Level.FINE)) {
                _logger.fine("poolname " + resource.getPoolName() + "resource " + resource.getJndiName());
            }
            ResourceInfo resourceInfo = ConnectorsUtil.getResourceInfo(resource);
            if ((resource.getPoolName().equalsIgnoreCase(poolInfo.getName())) && isReferenced(resourceInfo)
                    && isEnabled(resource)){
                if(_logger.isLoggable(Level.FINE)) {
                    _logger.fine("Connector resource "  + resource.getJndiName() + "refers "
                        + poolInfo + "in this server instance and is enabled");
View Full Code Here

        }
        return resource;
    }

    public Resource getResource(String jndiName, String appName, String moduleName, Class resourceType) {
        ResourceInfo resourceInfo = new ResourceInfo(jndiName, appName, moduleName);
        return getResource(resourceInfo, resourceType);
    }
View Full Code Here

    protected void deleteDefaultConnectorResources() {
        for (ConnectionDefDescriptor aConnectionDefs_ : connectionDefs_) {
            String connectionDefName = aConnectionDefs_.getConnectionFactoryIntf();
            String resourceJndiName = connectorRuntime_.getDefaultResourceName(moduleName_, connectionDefName);
            try {
                ResourceInfo resourceInfo = new ResourceInfo(resourceJndiName);
                connectorRuntime_.deleteConnectorResource(resourceInfo);
            } catch (ConnectorRuntimeException cre) {
                _logger.log(Level.WARNING, "rar.undeployment.default_resource_delete_fail", resourceJndiName);
                if(_logger.isLoggable(Level.FINE)) {
                    _logger.log(Level.FINE, "Error while trying to delete the default connector resource", cre);
View Full Code Here

            String connectionDefName = descriptor.getConnectionFactoryIntf();
            String resourceName = connectorRuntime_.getDefaultResourceName(moduleName_, connectionDefName);
            String poolName = connectorRuntime_.getDefaultPoolName(moduleName_, connectionDefName);

            PoolInfo poolInfo = new PoolInfo(poolName);
            ResourceInfo resourceInfo = new ResourceInfo(resourceName);
            connectorRuntime_.createConnectorResource(resourceInfo, poolInfo, null);
            desc_.addDefaultResourceName(resourceName);

            if(_logger.isLoggable(Level.FINE)) {
                _logger.log(Level.FINE, "Created default connector resource [ " + resourceName + " ] " );
View Full Code Here

            _logger.log(Level.FINE, "Created SUN-RA connection pool:", poolInfo);
        }

        String jndiName = (String) desc_.getSunDescriptor().
                getResourceAdapter().getValue(ResourceAdapter.JNDI_NAME);
        ResourceInfo resourceInfo = new ResourceInfo(jndiName);
        connectorRuntime_.createConnectorResource(resourceInfo, poolInfo, null);
        if(_logger.isLoggable(Level.FINE)) {
            _logger.log(Level.FINE, "Created SUN-RA connector resource : ", resourceInfo);
        }
View Full Code Here

        if(suffix != null){
            env = new Hashtable();
            env.put(ConnectorConstants.JNDI_SUFFIX_PROPERTY, suffix);
            jndiName = jndiName.substring(0, jndiName.lastIndexOf(suffix));
        }
        ResourceInfo actualResourceInfo = new ResourceInfo(jndiName, resourceInfo.getApplicationName(),
                resourceInfo.getModuleName());
        return namingService.lookup(actualResourceInfo, actualResourceInfo.getName(), env);
    }
View Full Code Here

TOP

Related Classes of org.glassfish.resourcebase.resources.api.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.