Package javax.naming

Examples of javax.naming.Reference


     */
    public Object getObjectInstance(final Object obj, final Name name, final Context nameCtx, final Hashtable<?, ?> environment)
            throws NamingException {

        // Get the reference
        Reference ref = (Reference) obj;

        // Get the class name
        String clname = ref.getClassName();

        // Check the class name
        if (!ref.getClassName().equals(FACTORY_TYPE)) {
            throw new NamingException("Cannot create object : required type is '" + FACTORY_TYPE + "', but found type is '"
                    + clname + "'.");
        }

        URL url = null;
        String urlString = (String) ref.get("url").getContent();

        if (urlString != null) {
            try {
                url = new URL(urlString);
            } catch (MalformedURLException e) {
View Full Code Here


     */
    @Override
    public Reference getReference() throws NamingException {

        // Build the reference to the factory
        Reference reference = new Reference(getItfClassName(), getFactoryClassName(), null);
        updateRefAddr(reference);
        return reference;
    }
View Full Code Here

     */
    @Override
    public Reference getReference() throws NamingException {

        // Build the reference to the factory
        Reference reference = new Reference(getItfClassName(), getFactoryClassName(), null);
        reference.add(new StringRefAddr(EMBEDDED_ID, this.embeddedID.toString()));
        updateRefAddr(reference);
        return reference;
    }
View Full Code Here

      {
         return ((InVMContext)value).lookup(name.substring(i));
      }
      if (value instanceof Reference)
      {
         Reference ref = (Reference)value;
         RefAddr refAddr = ref.get("nns");

         // we only deal with references create by NonSerializableFactory
         String key = (String)refAddr.getContent();
         return NonSerializableFactory.lookup(key);
      }
View Full Code Here

     */
    public Object getObjectInstance(final Object obj, final Name name, final Context nameCtx, final Hashtable<?, ?> environment)
            throws Exception {

        // Check if the reference classname is valid
        Reference reference = (Reference) obj;
        if (!FACTORY_TYPE.equals(reference.getClassName())) {
            return null;
        }

        // Build Mimemessage wrapping a session object
        MimeMessage mimeMessage = new MimeMessage(Session.getInstance(getSessionProperties(reference),
View Full Code Here

     */
    public Object getObjectInstance(final Object obj, final Name name, final Context nameCtx, final Hashtable<?, ?> environment)
            throws Exception {

        // Check if the reference classname is valid
        Reference reference = (Reference) obj;
        if (!FACTORY_TYPE.equals(reference.getClassName())) {
            return null;
        }

        // Create and return a new Session object
        Session session = Session.getInstance(getSessionProperties(reference), getAuthenticator(reference));
View Full Code Here

     */
    @Override
    public Reference getReference() throws NamingException {

        // Build the reference for the JavaMailSession factory
        Reference reference = new Reference(getType(), JavaMailSessionFactory.class.getName(), null);

        // Update the reference
        updateRefAddr(reference);

        return reference;
View Full Code Here

     */
    @Override
    public Reference getReference() throws NamingException {

        // Build the reference for the JavaMailSession factory
        Reference reference = new Reference(getType(), JavaMailMimePartDataSourceFactory.class.getName(), null);

        // Add the recipients
        // TO
        putObject(reference, JavaMailMimePartDataSourceFactory.TO_RECIPIENTS, this.toRecipients);

        // CC
        putObject(reference, JavaMailMimePartDataSourceFactory.CC_RECIPIENTS, this.ccRecipients);

        // BCC
        putObject(reference, JavaMailMimePartDataSourceFactory.BCC_RECIPIENTS, this.bccRecipients);

        // Add subject
        reference.add(new StringRefAddr(JavaMailMimePartDataSourceFactory.SUBJECT, this.subject));

        // Update the reference
        updateRefAddr(reference);

        return reference;
View Full Code Here

         {
            if (hasJndiBoundBeanManager(unit))
            {
               String path = JndiUtils.getJndiSubcontexPathForBeanManager(moduleInformer, unit);
               Context subcontext = Util.createSubcontext(rootContext, path);
               Reference reference = new Reference(BeanManager.class.getName(), "org.jboss.weld.integration.deployer.jndi.JBossBeanManagerObjectFactory", null);
               reference.add(new StringRefAddr(REFADDR_ID, IdFactory.getIdFromClassLoader(unit.getClassLoader())));
               subcontext.bind("BeanManager", reference);
            }
         }
         catch (NamingException e)
         {
View Full Code Here

    * @throws Exception for any error
    */
   public void startService(String jndiContextPath, String managerObjectFactoryClass) throws Exception
   {
      jndiName = jndiContextPath;
      Reference managerReference = new Reference(BeanManager.class.getName(), managerObjectFactoryClass, null);
      bind(jndiContextPath, managerReference);
   }
View Full Code Here

TOP

Related Classes of javax.naming.Reference

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.