Package javax.naming

Examples of javax.naming.Reference


   public String toString() {
      return this.topicName;
   }

   public Reference getReference() {
      Reference ret = new Reference(this.getClass().getName(), XBObjectFactory.class.getName(), null);
      ret.add(new StringRefAddr("topicName", this.topicName));
      ret.add(new StringRefAddr("queueName", this.queueName));
      ret.add(new StringRefAddr("forceQueuing", "" + this.forceQueuing));
      return ret;
   }
View Full Code Here


  
   // Referenceable implementation ---------------------------------------
  
   public Reference getReference() throws NamingException
   {
      return new Reference("org.jboss.jms.destination.JBossDestination",
                           new SerializableObjectRefAddr("JBM-DEST", this),
                           "org.jboss.jms.referenceable.DestinationObjectFactory",
                           null);
   }
View Full Code Here

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

        Reference ref = (Reference) obj;

        String dsname = (String) ref.get("datasource.name").getContent();
        ConnectionManager ds = ConnectionManager.getConnectionManager(dsname);
        if (ds == null) {
            // The DataSource was not in the EasyBeans Server: Create it.
            logger.debug("Creating a new Connection Manager for {0}", dsname);
            try {
                // build a new datasource for another server
                ds = new ConnectionManager();
                ds.setDSName(dsname);
                ds.setUrl((String) ref.get("datasource.url").getContent());
                ds.setClassName((String) ref.get("datasource.classname").getContent());
                ds.setUserName((String) ref.get("datasource.username").getContent());
                ds.setPassword((String) ref.get("datasource.password").getContent());
                ds.setTransactionIsolation((String) ref.get("datasource.isolationlevel").getContent());
                ds.poolConfigure((String) ref.get("connchecklevel").getContent(),
                        (String) ref.get("connmaxage").getContent(), (String) ref.get("maxopentime").getContent(),
                        (String) ref.get("connteststmt").getContent(), (String) ref.get("pstmtmax").getContent(),
                        (String) ref.get("minconpool").getContent(), (String) ref.get("maxconpool").getContent(),
                        (String) ref.get("maxwaittime").getContent(), (String) ref.get("maxwaiters").getContent(),
                        (String) ref.get("samplingperiod").getContent());
            } catch (Exception e) {
                logger.error("DataSourceFactory error", e);
            }
        }
        return ds;
View Full Code Here

  
   // Referenceable implementation -----------------------------------------------------------------
  
   public Reference getReference() throws NamingException
   {
      return new Reference("org.jboss.jms.client.JBossConnectionFactory",
               new SerializableObjectRefAddr("JBM-CF", this),
               "org.jboss.jms.referenceable.ConnectionFactoryObjectFactory",
               null);
   }
View Full Code Here

     * @param encName the name of the object to bind in enc
     * @param url the URL to register in the context
     */
    public static void bindLinkRefEnvURL(final String encName, final String url) {
        // Specify the factory to use with the right URL
        Reference ref = new Reference(URL.class.getName(), URLFactory.class.getName(), null);
        StringRefAddr refAddr = new StringRefAddr("url", url);
        ref.add(refAddr);
        try {
            getContext(JAVA_COMP_ENV).rebind(encName, ref);
        } catch (NamingException e) {
            logger.error("Cannot bind an URL with name {0} with ENC name {1}", url, encName, e);
        }
View Full Code Here

            logger.error("No object was found for JNDI name {0}", name);
        }

        // Display some meaningful information if the Reference was not processed
        if (o instanceof Reference) {
            Reference ref = (Reference) o;
            logger.warn("Reference not processed: " + ref);
            logger.warn("LookupError({0}): The ObjectFactory({1}) was not found with TCCL {2}",
                        name,
                        ref.getFactoryClassName(),
                        Thread.currentThread().getContextClassLoader());
        }
        return o;
    }
View Full Code Here

     * @exception NamingException If a naming exception was encountered while
     *            retrieving the reference.
     */
    public Reference getReference() throws NamingException {

        Reference ref = new Reference(this.getClass().getName(), DataSourceFactory.class.getName(), null);
        // These values are used by ObjectFactory (see DataSourceFactory.java)
        ref.add(new StringRefAddr("datasource.name", getDSName()));
        ref.add(new StringRefAddr("datasource.url", getUrl()));
        ref.add(new StringRefAddr("datasource.classname", getClassName()));
        ref.add(new StringRefAddr("datasource.username", getUserName()));
        ref.add(new StringRefAddr("datasource.password", getPassword()));
        ref.add(new StringRefAddr("datasource.isolationlevel", getTransactionIsolation()));
        Integer checklevel = Integer.valueOf(getCheckLevel());
        ref.add(new StringRefAddr("connchecklevel", checklevel.toString()));
        Integer maxage = Integer.valueOf(getMaxAge());
        ref.add(new StringRefAddr("connmaxage", maxage.toString()));
        Integer maxopentime = Integer.valueOf(getMaxOpenTime());
        ref.add(new StringRefAddr("maxopentime", maxopentime.toString()));
        ref.add(new StringRefAddr("connteststmt", getTestStatement()));
        Integer pstmtmax = Integer.valueOf(getPstmtMax());
        ref.add(new StringRefAddr("pstmtmax", pstmtmax.toString()));
        Integer minpool = Integer.valueOf(getPoolMin());
        ref.add(new StringRefAddr("minconpool", minpool.toString()));
        Integer maxpool = Integer.valueOf(getPoolMax());
        ref.add(new StringRefAddr("maxconpool", maxpool.toString()));
        Integer maxwaittime = Integer.valueOf(getMaxWaitTime());
        ref.add(new StringRefAddr("maxwaittime", maxwaittime.toString()));
        Integer maxwaiters = Integer.valueOf(getMaxWaiters());
        ref.add(new StringRefAddr("maxwaiters", maxwaiters.toString()));
        Integer samplingperiod = Integer.valueOf(getSamplingPeriod());
        ref.add(new StringRefAddr("samplingperiod", samplingperiod.toString()));
        return ref;
    }
View Full Code Here

     *         to be tried.
     */
    public Object getObjectInstance(final Object obj, final Name name, final Context nameCtx, final Hashtable<?, ?> environment)
            throws Exception {
        if (obj instanceof Reference) {
            Reference ref = (Reference) obj;

            // get the embeddedID, getContainerId(), getFactoryName()
            RefAddr containerIDAddr = ref.get(AbsCallRef.CONTAINER_ID);
            RefAddr factoryNameAddr = ref.get(AbsCallRef.FACTORY_NAME);
            RefAddr itfClassNameAddr = ref.get(AbsCallRef.INTERFACE_NAME);
            RefAddr useIDAddr = ref.get(AbsCallRef.USE_ID);

            String containerID = (String) containerIDAddr.getContent();
            String factoryName = (String) factoryNameAddr.getContent();
            String itfClassName = (String) itfClassNameAddr.getContent();
            boolean useID = Boolean.valueOf((String) useIDAddr.getContent()).booleanValue();
View Full Code Here

     */
    @Override
    public Object getObjectInstance(final Object obj, final Name name, final Context nameCtx, final Hashtable<?, ?> environment)
            throws Exception {
        if (obj instanceof Reference) {
            Reference ref = (Reference) obj;

            // get the properties
            RefAddr remoteInterfaceAddr = ref.get(EJBHomeCallRef.REMOTE_INTERFACE);
            this.remoteInterface =  (String) remoteInterfaceAddr.getContent();
        }

        // Now call the super method.
        return super.getObjectInstance(obj, name, nameCtx, environment);
View Full Code Here

     *         to be tried.
     */
    public Object getObjectInstance(final Object obj, final Name name, final Context nameCtx, final Hashtable<?, ?> environment)
            throws Exception {
        if (obj instanceof Reference) {
            Reference ref = (Reference) obj;

            // get the embeddedID, getContainerId(), getFactoryName()
            RefAddr embeddedIDAddr = ref.get(LocalCallRef.EMBEDDED_ID);
            RefAddr containerIDAddr = ref.get(AbsCallRef.CONTAINER_ID);
            RefAddr factoryNameAddr = ref.get(AbsCallRef.FACTORY_NAME);
            RefAddr itfClassNameAddr = ref.get(AbsCallRef.INTERFACE_NAME);
            RefAddr useIDAddr = ref.get(AbsCallRef.USE_ID);

            Integer embeddedID = Integer.valueOf((String) embeddedIDAddr.getContent());
            String containerID = (String) containerIDAddr.getContent();
            String factoryName = (String) factoryNameAddr.getContent();
            String itfClassName = (String) itfClassNameAddr.getContent();
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.