Package org.glassfish.resourcebase.resources.api

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


    private ResourcesUtil(){
    }

    public Resources getGlobalResources(){
        ResourceInfo resourceInfo = null;
        return getRuntime().getResources(resourceInfo);
    }
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

     */
    public Object lookupPMResource(ResourceInfo resourceInfo, boolean force) throws NamingException{
        Object result ;
        try{
            if(!resourceInfo.getName().endsWith(PM_JNDI_SUFFIX)){
                ResourceInfo tmpInfo = new ResourceInfo(resourceInfo.getName()+PM_JNDI_SUFFIX,
                        resourceInfo.getApplicationName(), resourceInfo.getModuleName());
                resourceInfo = tmpInfo;
            }

            result = connectorResourceAdmService.lookup(resourceInfo);
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public Object lookupPMResource(String jndiName, boolean force) throws NamingException {
        ResourceInfo resourceInfo = new ResourceInfo(jndiName);
        return lookupPMResource(resourceInfo, force);
    }
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public Object lookupNonTxResource(String jndiName, boolean force) throws NamingException {
        ResourceInfo resourceInfo = new ResourceInfo(jndiName);
        return lookupNonTxResource(resourceInfo, force);
    }
View Full Code Here

    public Object lookupNonTxResource(ResourceInfo resourceInfo, boolean force) throws NamingException {

        Object result ;
        try{
            if(!resourceInfo.getName().endsWith(NON_TX_JNDI_SUFFIX)){
                ResourceInfo tmpInfo = new ResourceInfo(resourceInfo.getName()+NON_TX_JNDI_SUFFIX,
                        resourceInfo.getApplicationName(), resourceInfo.getModuleName());
                resourceInfo = tmpInfo;
            }
            result = connectorResourceAdmService.lookup(resourceInfo);
        }catch(NamingException ne){
View Full Code Here

                msd.setResourceId(appName);
            }

            if (msd.getName().startsWith(ConnectorConstants.JAVA_GLOBAL_SCOPE_PREFIX)
                    || msd.getName().startsWith(ConnectorConstants.JAVA_APP_SCOPE_PREFIX)) {
                ResourceInfo resourceInfo = new ResourceInfo(msd.getName(), appName, moduleName);
                try {
                    resourceNamingService.publishObject(resourceInfo, proxy, true);
                    msd.setDeployed(true);
                } catch (NamingException e) {
                    Object params[] = new Object[]{appName, msd.getName(), e};
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

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.