FileDocCategorySizeDatePackage
JndiBinder.javaAPI DocJBoss 4.2.12801Fri Jul 13 20:53:50 BST 2007org.jboss.ejb3.embedded

JndiBinder

public class JndiBinder extends Object
Comment
author
Bill Burke
version
$Revision: 60233 $

Fields Summary
private String
bindTo
private Object
target
private boolean
serializable
private Hashtable
properties
Constructors Summary
Methods Summary
public voidsetBindTo(java.lang.String bindTo)

      this.bindTo = bindTo;
   
public voidsetJndiProperties(java.util.Hashtable properties)

      this.properties = properties;
   
public voidsetSerializable(boolean serializable)

      this.serializable = serializable;
   
public voidsetTarget(java.lang.Object target)

      this.target = target;
   
public voidstart()

      InitialContext ctx = EJB3Util.getInitialContext(properties);
      
      try
      {
         if (serializable)
         {
            Util.rebind(ctx, bindTo, target);
         }
         else
         {
            NonSerializableFactory.rebind(ctx, bindTo, target);
         }
      } catch (NamingException e)
      {
         NamingException namingException = new NamingException("Could not bind JndiBinder service into JNDI under jndiName:" + ctx.getNameInNamespace() + "/" + bindTo);
         namingException.setRootCause(e);
         throw namingException;
      }
   
public voidstop()

      InitialContext ctx = EJB3Util.getInitialContext(properties);
      if (serializable)
      {
         Util.unbind(ctx, bindTo);
      }
      else
      {
         NonSerializableFactory.unbind(ctx, bindTo);
      }