Package org.glassfish.resourcebase.resources.api

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


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

                    throws NamingException {

        // name to lookup in the external factory
        String jndiLookupName = "";
        String jndiFactoryClass = null;
       ResourceInfo resourceInfo = null;

        // get the target initial naming context and the lookup name
        Reference ref = (Reference) obj;
        Enumeration addrs = ref.getAll();
        while (addrs.hasMoreElements()) {
            RefAddr addr = (RefAddr) addrs.nextElement();

            String prop = addr.getType();
            if (prop.equals("resourceInfo")) {
                resourceInfo = (ResourceInfo)addr.getContent();
            }
            else if (prop.equals("jndiLookupName")) {
                jndiLookupName = (String) addr.getContent();
            }
            else if (prop.equals("jndiFactoryClass")) {
                jndiFactoryClass = (String) addr.getContent();
            }
        }

        if (resourceInfo == null) {
        throw new NamingException("JndiProxyObjectFactory: no resourceInfo context info");
      }

      ProxyRefAddr contextAddr =
                (ProxyRefAddr)ref.get(resourceInfo.getName());
      Hashtable env = null;
      if (contextAddr == null ||
            jndiFactoryClass == null ||
          (env = (Hashtable)(contextAddr.getContent())) == null) {
        throw new NamingException("JndiProxyObjectFactory: no info in the " +
View Full Code Here

                    applicationName = ((Application)((Module)parentObject).getParent()).getName();
                }

                if (resource instanceof BindableResource) {
                    BindableResource bindableResource = (BindableResource) resource;
                    ResourceInfo resourceInfo =
                            new ResourceInfo(bindableResource.getJndiName(), applicationName, moduleName);
                    resourcesBinder.deployResource(resourceInfo, resource);
                } else if (resource instanceof ResourcePool) {
                    // ignore, as they are loaded lazily
                } else {
                    // only other resources left are RAC, CWSM
View Full Code Here


        if (mailRes == null) {
            _logger.log(Level.INFO, "core.resourcedeploy_error");
        } else {
            ResourceInfo resourceInfo = new ResourceInfo(mailRes.getJndiName(), applicationName, moduleName);
            //registers the jsr77 object for the mail resource deployed
            /* TODO Not needed any more ?
            /*ManagementObjectManager mgr =
                getAppServerSwitchObject().getManagementObjectManager();
            mgr.registerJavaMailResource(mailRes.getJndiName());*/
 
View Full Code Here

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

     */
    public void undeployResource(Object resource, String applicationName, String moduleName) throws Exception {
        MailResource mailRes =
                (MailResource) resource;
        // converts the config data to j2ee resource
        ResourceInfo resourceInfo = new ResourceInfo(mailRes.getJndiName(), applicationName, moduleName);
        deleteResource(mailRes, resourceInfo);
    }
View Full Code Here

     */
    public synchronized void undeployResource(Object resource) throws Exception {
        MailResource mailRes =
                (MailResource) resource;
        // converts the config data to j2ee resource
        ResourceInfo resourceInfo = ResourceUtil.getResourceInfo(mailRes);
        deleteResource(mailRes, resourceInfo);
    }
View Full Code Here

    public boolean isJdbcPoolReferredInServerInstance(PoolInfo poolInfo) {

        Collection<JdbcResource> jdbcResources = getRuntime().getResources(poolInfo).getResources(JdbcResource.class);

        for (JdbcResource resource : jdbcResources) {
            ResourceInfo resourceInfo = ConnectorsUtil.getResourceInfo(resource);
            //Have to check isReferenced here!
            if ((resource.getPoolName().equalsIgnoreCase(poolInfo.getName())) &&
                    ResourcesUtil.createInstance().isReferenced(resourceInfo)
                    && ResourcesUtil.createInstance().isEnabled(resource)){
                if (_logger.isLoggable(Level.FINE)) {
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.