org.ow2.carol.cmi.smart.spi
Class SmartContextFactory

java.lang.Object
  extended by org.ow2.carol.cmi.smart.spi.SmartContextFactory
All Implemented Interfaces:
javax.naming.spi.InitialContextFactory

public class SmartContextFactory
extends java.lang.Object
implements javax.naming.spi.InitialContextFactory

Initial Context factory used on the client side.

Author:
The new CMI team

Field Summary
static java.lang.String CMI_CONFIG_SMART
          Smart CMI configuration.
static java.lang.String CMI_FACTORY
          CMI initial context factory.
static java.lang.String CMI_SMART_FACTORY
          CMI delegating factory.
static java.lang.String INITIAL_PROVIDER_URLS
          Property name for defining the initial provider URLs.
static java.lang.String WRAPPED_INITIAL_CONTEXT_FACTORY
          Property name for defining the wrapped InitialContextFactory.
static java.lang.String WRAPPED_PROTOCOL
          Property name for defining the protocol.
 
Constructor Summary
SmartContextFactory()
          Default constructor.
 
Method Summary
 java.lang.String getHost(java.lang.String url)
          Get the hostname of given url.
 javax.naming.Context getInitialContext(java.util.Hashtable environment)
          Creates an Initial Context for beginning name resolution.
 int getPort(java.lang.String url)
          Get the port number of given url.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WRAPPED_PROTOCOL

public static final java.lang.String WRAPPED_PROTOCOL
Property name for defining the protocol.

See Also:
Constant Field Values

INITIAL_PROVIDER_URLS

public static final java.lang.String INITIAL_PROVIDER_URLS
Property name for defining the initial provider URLs.

See Also:
Constant Field Values

WRAPPED_INITIAL_CONTEXT_FACTORY

public static final java.lang.String WRAPPED_INITIAL_CONTEXT_FACTORY
Property name for defining the wrapped InitialContextFactory.

See Also:
Constant Field Values

CMI_FACTORY

public static final java.lang.String CMI_FACTORY
CMI initial context factory.

See Also:
Constant Field Values

CMI_CONFIG_SMART

public static final java.lang.String CMI_CONFIG_SMART
Smart CMI configuration.

See Also:
Constant Field Values

CMI_SMART_FACTORY

public static final java.lang.String CMI_SMART_FACTORY
CMI delegating factory.

See Also:
Constant Field Values
Constructor Detail

SmartContextFactory

public SmartContextFactory()
Default constructor.

Method Detail

getInitialContext

public javax.naming.Context getInitialContext(java.util.Hashtable environment)
                                       throws javax.naming.NamingException
Creates an Initial Context for beginning name resolution. Special requirements of this context are supplied

Specified by:
getInitialContext in interface javax.naming.spi.InitialContextFactory
Parameters:
environment - the given environment.
Returns:
the context.
Throws:
javax.naming.NamingException - if no context can be built.

getHost

public java.lang.String getHost(java.lang.String url)
Get the hostname of given url.

Parameters:
url - the given url.
Returns:
the correspond host name.

getPort

public int getPort(java.lang.String url)
Get the port number of given url.

Parameters:
url - the given url.
Returns:
the correspond port number.


Copyright © 2008 OW2 Consortium. All Rights Reserved.