Package javax.naming

Examples of javax.naming.Referenceable


                                                String className)
            throws Exception {
        println("Testing recreated empty data source.");
        // Create an empty data source.
        Object ds = Class.forName(className).newInstance();
        Referenceable refDs = (Referenceable)ds;
        Reference dsAsReference = refDs.getReference();
        String factoryClassName = dsAsReference.getFactoryClassName();
        ObjectFactory factory =
            (ObjectFactory)Class.forName(factoryClassName).newInstance();
        Object recreatedDs =
            factory.getObjectInstance(dsAsReference, null, null, null);
View Full Code Here


            } else {
                fail("'" + property + "' not settable - update test!!");
            }
        }

        Referenceable refDs = (Referenceable)ds;
        Reference dsAsReference = refDs.getReference();
        String factoryClassName = dsAsReference.getFactoryClassName();
        ObjectFactory factory =
            (ObjectFactory)Class.forName(factoryClassName).newInstance();
        Object recreatedDs =
            factory.getObjectInstance(dsAsReference, null, null, null);
View Full Code Here

    /**
     * @see Referenceable#getReference()
     */
    public Reference getReference() throws NamingException {
        if (config instanceof Referenceable) {
            Referenceable confref = (Referenceable)config;
            if (reference == null) {
                reference = new Reference(RepositoryImpl.class.getName(), RepositoryImpl.Factory.class.getName(), null);
                // carry over all addresses from referenceable config
                for (Enumeration en = confref.getReference().getAll(); en.hasMoreElements(); ) {
                    reference.add((RefAddr)(en.nextElement()));
                }

                // also add the information required by factory class
                reference.add(new StringRefAddr(Factory.RCF, confref.getReference().getFactoryClassName()));
                reference.add(new StringRefAddr(Factory.RCC, config.getClass().getName()));
            }

            return reference;
        }
View Full Code Here

        if (!(content instanceof String))
            throw new NamingException("'uniqueName' RefAddr content is not of type java.lang.String");
        String uniqueName = (String) content;

        if (log.isDebugEnabled()) { log.debug("getting registered resource with uniqueName '" + uniqueName + "'"); }
        Referenceable resource = ResourceRegistrar.get(uniqueName);
        if (resource == null)
            throw new NamingException("no resource registered with uniqueName '" + uniqueName + "', available resources: " + ResourceRegistrar.getResourcesUniqueNames());

        return resource;
    }
View Full Code Here

    /**
     * @see Referenceable#getReference()
     */
    public Reference getReference() throws NamingException {
        if (config instanceof Referenceable) {
            Referenceable confref = (Referenceable)config;
            if (reference == null) {
                reference = new Reference(RepositoryImpl.class.getName(), RepositoryImpl.Factory.class.getName(), null);
                // carry over all addresses from referenceable config
                for (Enumeration<RefAddr> en = confref.getReference().getAll(); en.hasMoreElements(); ) {
                    reference.add(en.nextElement());
                }

                // also add the information required by factory class
                reference.add(new StringRefAddr(Factory.RCF, confref.getReference().getFactoryClassName()));
                reference.add(new StringRefAddr(Factory.RCC, config.getClass().getName()));
            }

            return reference;
        }
View Full Code Here

    /**
     * @see Referenceable#getReference()
     */
    public Reference getReference() throws NamingException {
        if (config instanceof Referenceable) {
            Referenceable confref = (Referenceable)config;
            if (reference == null) {
                reference = new Reference(RepositoryImpl.class.getName(), RepositoryImpl.Factory.class.getName(), null);
                // carry over all addresses from referenceable config
                for (Enumeration en = confref.getReference().getAll(); en.hasMoreElements(); ) {
                    reference.add((RefAddr)(en.nextElement()));
                }

                // also add the information required by factory class
                reference.add(new StringRefAddr(Factory.RCF, confref.getReference().getFactoryClassName()));
                reference.add(new StringRefAddr(Factory.RCC, config.getClass().getName()));
            }

            return reference;
        }
View Full Code Here

    /**
     * @see Referenceable#getReference()
     */
    public Reference getReference() throws NamingException {
        if (config instanceof Referenceable) {
            Referenceable confref = (Referenceable)config;
            if (reference == null) {
                reference = new Reference(RepositoryImpl.class.getName(), RepositoryImpl.Factory.class.getName(), null);
                // carry over all addresses from referenceable config
                for (Enumeration en = confref.getReference().getAll(); en.hasMoreElements(); ) {
                    reference.add((RefAddr)(en.nextElement()));
                }

                // also add the information required by factory class
                reference.add(new StringRefAddr(Factory.RCF, confref.getReference().getFactoryClassName()));
                reference.add(new StringRefAddr(Factory.RCC, config.getClass().getName()));
            }

            return reference;
        }
View Full Code Here

         }
      }

      // Do not use rebind, the binding should be unique
      // [JBWS-1499] - Revisit WebServiceRefHandler JNDI rebind
      Referenceable serviceReferenceable = buildServiceReferenceable(serviceImplClass, targetClassName, serviceRef);
      Util.bind(encCtx, encName, serviceReferenceable);

   }
View Full Code Here

         }
      }

      // Do not use rebind, the binding should be unique
      // [JBWS-1499] - Revisit WebServiceRefHandler JNDI rebind
      Referenceable serviceReferenceable = buildServiceReferenceable(serviceImplClass, targetClassName, serviceRef);
      Util.bind(encCtx, encName, serviceReferenceable);

   }
View Full Code Here

        }

        private Referenceable getReferenceable() {
            // FIXME SPIProviderResolver won't require a TCCL in the future
            ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
            final Referenceable referenceable;
            try {
                Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader());
                final SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
                final ServiceRefHandler serviceRefHandler = spiProvider.getSPI(ServiceRefHandlerFactory.class).getServiceRefHandler();
                return serviceRefHandler.createReferenceable(serviceRef);
View Full Code Here

TOP

Related Classes of javax.naming.Referenceable

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.