Package javax.naming

Examples of javax.naming.BinaryRefAddr


      Object instance = null;
      if (obj instanceof Reference)
      {
         Reference ref = (Reference) obj;
         // Check the local id
         BinaryRefAddr localID = (BinaryRefAddr) ref.get("VMID");
         byte[] idBytes = (byte[]) localID.getContent();
         ByteArrayInputStream bais = new ByteArrayInputStream(idBytes);
         ObjectInputStream ois = new ObjectInputStream(bais);
         UID id = (UID) ois.readObject();
         if( id.equals(vmID) == true )
         {
            // Use the local datasource
            StringRefAddr jndiAddr = (StringRefAddr) ref.get("JndiName");
            String jndiName = (String) jndiAddr.getContent();
            instance = NonSerializableFactory.lookup(jndiName);
         }
         else
         {
            // Use the embedded proxy
            BinaryRefAddr proxyAddr = (BinaryRefAddr) ref.get("ProxyData");
            byte[] proxyBytes = (byte[]) proxyAddr.getContent();
            ByteArrayInputStream bais2 = new ByteArrayInputStream(proxyBytes);
            ObjectInputStream ois2 = new ObjectInputStream(bais2);
            instance = ois2.readObject();
         }
      }
View Full Code Here


         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         ObjectOutputStream oos = new ObjectOutputStream(baos);
         oos.writeObject(theProxy);
         oos.close();
         byte[] proxyBytes = baos.toByteArray();
         BinaryRefAddr dsAddr = new BinaryRefAddr("ProxyData", proxyBytes);
         String factory = DataSourceFactory.class.getName();
         Reference dsRef = new Reference("javax.sql.DataSource", dsAddr, factory, null);
         referenceable.setReference(dsRef);
         // Set the VMID as the address local/remote indicator
         baos.reset();
         ObjectOutputStream oos2 = new ObjectOutputStream(baos);
         oos2.writeObject(DataSourceFactory.vmID);
         oos2.close();
         byte[] id = baos.toByteArray();
         BinaryRefAddr localAddr = new BinaryRefAddr("VMID", id);
         dsRef.add(localAddr);
         /* Bind the Referenceable connection factory into JNDI and set the
         JndiName value of the reference address for use by the DataSourceFactory
         when looking up the local factory from the NonSerializableFactory.
         */
 
View Full Code Here

         final ObjectOutputStream oos = new ObjectOutputStream(baos);
         oos.writeObject(theProxy);
         oos.close();

         final byte[] proxyBytes = baos.toByteArray();
         final BinaryRefAddr dsAddr = new BinaryRefAddr("ProxyData", proxyBytes);
         final String remoteFactoryName = RemoteConnectionFactoryHelper.class.getName();
         final String localFactoryName = cf.getClass().getName();

         final Reference dsRef = new Reference(localFactoryName, dsAddr, remoteFactoryName, null);
         referenceable.setReference(dsRef);

         baos.reset();
         final ObjectOutputStream oos2 = new ObjectOutputStream(baos);
         oos2.writeObject(RemoteConnectionFactoryHelper.vmID);
         oos2.close();
         final byte[] id = baos.toByteArray();
         final BinaryRefAddr localAddr = new BinaryRefAddr("VMID", id);
         dsRef.add(localAddr);

         final StringRefAddr jndiRef = new StringRefAddr("JndiName", bindName);
         dsRef.add(jndiRef);
         Util.rebind(initCtx, bindName, cf);
View Full Code Here

    
      if (obj instanceof Reference)
      {
         Reference ref = (Reference) obj;
         // Check the local id
         BinaryRefAddr localID = (BinaryRefAddr) ref.get("VMID");
         byte[] idBytes = (byte[]) localID.getContent();
         ByteArrayInputStream bais = new ByteArrayInputStream(idBytes);
         ObjectInputStream ois = new ObjectInputStream(bais);
         UID id = (UID) ois.readObject();
     
         if( id.equals(vmID) == true )
         {
            // Use the local datasource
            StringRefAddr jndiAddr = (StringRefAddr) ref.get("JndiName");
            String jndiName = (String) jndiAddr.getContent();
            instance = NonSerializableFactory.lookup(jndiName);
         }
         else
         {
            // Use the embedded proxy
            BinaryRefAddr proxyAddr = (BinaryRefAddr) ref.get("ProxyData");
            byte[] proxyBytes = (byte[]) proxyAddr.getContent();
            ByteArrayInputStream bais2 = new ByteArrayInputStream(proxyBytes);
            ObjectInputStream ois2 = new ObjectInputStream(bais2);
            instance = ois2.readObject();
         }
      }
View Full Code Here

   {
      Reference myRef = new Reference(ServiceReferenceable.class.getName(), ServiceObjectFactoryJAXWS.class.getName(), null);

      myRef.add(new StringRefAddr(SERVICE_IMPL_CLASS, serviceImplClass));
      myRef.add(new StringRefAddr(TARGET_CLASS_NAME, targetClassName));
      myRef.add(new BinaryRefAddr(SERVICE_REF_META_DATA, marshall(serviceRef)));

      return myRef;
   }
View Full Code Here

   public Reference getReference() throws NamingException
   {
      Reference myRef = new Reference(ServiceReferenceable.class.getName(), ServiceObjectFactoryJAXRPC.class.getName(), null);

      // Add a reference to the ServiceRefMetaData and WSDLDefinitions
      myRef.add(new BinaryRefAddr(SERVICE_REF_META_DATA, marshallServiceRef()));

      // FIXME: JBWS-1431 Merge ws-security config with jaxrpc/jaxws config
      if (getSecurityConfig() != null)
         myRef.add(new BinaryRefAddr(SECURITY_CONFIG, marshallSecurityConfig()));

      // Add references to port component links
      for (UnifiedPortComponentRefMetaData pcr : refMetaData.getPortComponentRefs())
      {
         String pcLink = pcr.getPortComponentLink();
View Full Code Here

   {
      Reference myRef = new Reference(ServiceReferenceable.class.getName(), ServiceObjectFactoryJAXWS.class.getName(), null);

      myRef.add(new StringRefAddr(SERVICE_IMPL_CLASS, serviceImplClass));
      myRef.add(new StringRefAddr(TARGET_CLASS_NAME, targetClassName));
      myRef.add(new BinaryRefAddr(SERVICE_REF_META_DATA, marshall(serviceRef)));

      return myRef;
   }
View Full Code Here

   public Reference getReference() throws NamingException
   {
      Reference myRef = new Reference(ServiceReferenceable.class.getName(), ServiceObjectFactoryJAXRPC.class.getName(), null);

      // Add a reference to the ServiceRefMetaData and WSDLDefinitions
      myRef.add(new BinaryRefAddr(SERVICE_REF_META_DATA, marshallServiceRef()));

      // FIXME: JBWS-1431 Merge ws-security config with jaxrpc/jaxws config
      if (getSecurityConfig() != null)
         myRef.add(new BinaryRefAddr(SECURITY_CONFIG, marshallSecurityConfig()));

      // Add references to port component links
      for (UnifiedPortComponentRefMetaData pcr : refMetaData.getPortComponentRefs())
      {
         String pcLink = pcr.getPortComponentLink();
View Full Code Here

      throw namingException;
    }

    return new Reference(
        Ejb3Configuration.class.getName(),
        new BinaryRefAddr("object", serialized ),
        Ejb3ConfigurationObjectFactory.class.getName(),
        null
    );
  }
View Full Code Here

      throw namingException;
    }

    return new Reference(
        Ejb3Configuration.class.getName(),
        new BinaryRefAddr("object", serialized ),
        Ejb3ConfigurationObjectFactory.class.getName(),
        null
    );
  }
View Full Code Here

TOP

Related Classes of javax.naming.BinaryRefAddr

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.