com.caucho.naming
Class LinkProxy

java.lang.Object
  extended by com.caucho.naming.LinkProxy
All Implemented Interfaces:
ObjectProxy, java.io.Serializable

public class LinkProxy
extends java.lang.Object
implements ObjectProxy, java.io.Serializable

An object proxy for a foreign JNDI factory.

See Also:
Serialized Form

Field Summary
protected  javax.naming.spi.InitialContextFactory _factory
           
protected  java.lang.Class _factoryClass
           
protected  java.lang.String _foreignName
           
protected  java.lang.String _jndiLocalName
           
protected  java.lang.String _jndiName
           
protected  java.util.Hashtable<java.lang.String,java.lang.String> _props
           
 
Constructor Summary
LinkProxy()
          Creates a new LinkProxy.
LinkProxy(javax.naming.spi.InitialContextFactory factory, java.util.Hashtable<java.lang.String,java.lang.String> props, java.lang.String name)
          Creates a new LinkProxy.
LinkProxy(java.lang.String name)
          Creates a new LinkProxy.
 
Method Summary
 void addInitParam(InitParam initParam)
          Adds init param.
 java.lang.Object createObject(java.util.Hashtable env)
          Creates the object from the proxy.
 void init()
          Initialize the resource.
 void setFactory(java.lang.Class factoryClass)
          Sets the factory
 void setForeignName(java.lang.String name)
          Sets the foreign-name
 void setJndiFactory(java.lang.Class factoryClass)
          Deprecated. Use setFactory(java.lang.Class)
 void setJndiLocalName(java.lang.String name)
          Sets the jndi name.
 void setJndiName(java.lang.String name)
          Sets the jndi name.
 void setName(java.lang.String name)
          Deprecated. Use setJndiName(java.lang.String)
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_factory

protected javax.naming.spi.InitialContextFactory _factory

_factoryClass

protected java.lang.Class _factoryClass

_props

protected java.util.Hashtable<java.lang.String,java.lang.String> _props

_jndiName

protected java.lang.String _jndiName

_jndiLocalName

protected java.lang.String _jndiLocalName

_foreignName

protected java.lang.String _foreignName
Constructor Detail

LinkProxy

public LinkProxy()
          throws javax.naming.NamingException
Creates a new LinkProxy.

Throws:
javax.naming.NamingException

LinkProxy

public LinkProxy(javax.naming.spi.InitialContextFactory factory,
                 java.util.Hashtable<java.lang.String,java.lang.String> props,
                 java.lang.String name)
          throws javax.naming.NamingException
Creates a new LinkProxy.

Parameters:
factory - the foreign factory
props - the properties for the object
name - the jndi-link path in the foreign namespace
Throws:
javax.naming.NamingException

LinkProxy

public LinkProxy(java.lang.String name)
          throws javax.naming.NamingException
Creates a new LinkProxy.

Parameters:
name - the jndi-link path in the foreign namespace
Throws:
javax.naming.NamingException
Method Detail

setJndiName

public void setJndiName(java.lang.String name)
Sets the jndi name.


setJndiLocalName

public void setJndiLocalName(java.lang.String name)
Sets the jndi name.


setName

public void setName(java.lang.String name)
Deprecated. Use setJndiName(java.lang.String)


setFactory

public void setFactory(java.lang.Class factoryClass)
Sets the factory


setJndiFactory

public void setJndiFactory(java.lang.Class factoryClass)
Deprecated. Use setFactory(java.lang.Class)


setForeignName

public void setForeignName(java.lang.String name)
Sets the foreign-name


addInitParam

public void addInitParam(InitParam initParam)
Adds init param.


createObject

public java.lang.Object createObject(java.util.Hashtable env)
                              throws javax.naming.NamingException
Creates the object from the proxy.

Specified by:
createObject in interface ObjectProxy
Parameters:
env - the calling environment
Returns:
the object named by the proxy.
Throws:
javax.naming.NamingException

init

@PostConstruct
public void init()
          throws java.lang.Exception
Initialize the resource.

Throws:
java.lang.Exception

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object