public class ProtocolConfigurationImpl extends java.lang.Object implements ProtocolConfiguration, ProtocolConfigurationImplMBean
Constructor and Description |
---|
ProtocolConfigurationImpl(java.lang.String name,
Protocol protocol,
java.util.Properties properties)
Build a new configuration with given parameters
|
Modifier and Type | Method and Description |
---|---|
void |
configure(java.util.Properties properties)
Configure this configuration with a given properties object
|
protected void |
extractJNDIProperties()
Extract JNDI properties of properties
|
java.lang.String |
getHost() |
protected java.lang.String |
getHostOfUrl(java.lang.String url)
Parses the given url, and returns the hostname
If not found, returns localhost
|
javax.naming.Context |
getInitialContext(java.util.Hashtable env)
Build an initial context with the given environment using our configuration
|
java.lang.String |
getInitialContextFactoryClassName()
MBean method : Gets the InitialContextFactory classname (Context.INITIAL_CONTEXT_FACTORY)
|
java.util.Hashtable |
getJndiEnv() |
java.lang.String |
getName() |
java.util.List |
getNames()
Gets JNDI names of the context with this configuration
|
java.lang.String |
getobjectName() |
int |
getPort() |
protected int |
getPortOfUrl(java.lang.String url)
Parses the given url, and returns the port number.
|
java.util.Properties |
getProperties() |
Protocol |
getProtocol() |
java.lang.String |
getProviderURL()
Gets the provider URL of this configuration (Context.PROVIDER_URL)
|
protected java.lang.String |
getValue(java.lang.String key)
Gets value of properties object
|
boolean |
iseventProvider() |
boolean |
isstateManageable() |
boolean |
isstatisticsProvider() |
protected void |
parseURL()
Parse URL to extract host and port
|
void |
setobjectName(java.lang.String name)
Sets the object name of this mbean
|
public ProtocolConfigurationImpl(java.lang.String name, Protocol protocol, java.util.Properties properties) throws ConfigurationException
name
- the name of this protocol configurationprotocol
- the protocol object used by this configurationproperties
- for this objectConfigurationException
- if configuration is not correctpublic void configure(java.util.Properties properties) throws ConfigurationException
configure
in interface ProtocolConfiguration
properties
- given propertiesConfigurationException
- if the given config is invalidprotected void extractJNDIProperties() throws ConfigurationException
ConfigurationException
- if properties are missingprotected void parseURL() throws ConfigurationException
ConfigurationException
- if URL is not correctpublic javax.naming.Context getInitialContext(java.util.Hashtable env) throws javax.naming.NamingException
getInitialContext
in interface ProtocolConfiguration
env
- parameters for the initial contextjavax.naming.NamingException
- if the context is not createdpublic Protocol getProtocol()
getProtocol
in interface ProtocolConfiguration
public java.lang.String getName()
getName
in interface ProtocolConfiguration
getName
in interface ProtocolConfigurationImplMBean
public java.util.Properties getProperties()
getProperties
in interface ProtocolConfiguration
public java.lang.String getHost()
getHost
in interface ProtocolConfiguration
public int getPort()
getPort
in interface ProtocolConfiguration
public java.lang.String getProviderURL()
ProtocolConfigurationImplMBean
getProviderURL
in interface ProtocolConfiguration
getProviderURL
in interface ProtocolConfigurationImplMBean
protected int getPortOfUrl(java.lang.String url) throws ConfigurationException
url
- given url on which extract port numberConfigurationException
- if URL is invalidprotected java.lang.String getHostOfUrl(java.lang.String url) throws ConfigurationException
url
- given url on which extract hostnameConfigurationException
- if URL is invalidprotected java.lang.String getValue(java.lang.String key) throws ConfigurationException
key
- the key of the propertiesConfigurationException
- if properties are missingpublic java.util.Hashtable getJndiEnv()
public java.lang.String getInitialContextFactoryClassName()
getInitialContextFactoryClassName
in interface ProtocolConfigurationImplMBean
public java.util.List getNames() throws javax.naming.NamingException
getNames
in interface ProtocolConfigurationImplMBean
javax.naming.NamingException
- if the names cannot be listedpublic java.lang.String getobjectName()
getobjectName
in interface ProtocolConfigurationImplMBean
public void setobjectName(java.lang.String name)
setobjectName
in interface ProtocolConfigurationImplMBean
name
- the Object Namepublic boolean iseventProvider()
iseventProvider
in interface ProtocolConfigurationImplMBean
public boolean isstateManageable()
isstateManageable
in interface ProtocolConfigurationImplMBean
public boolean isstatisticsProvider()
isstatisticsProvider
in interface ProtocolConfigurationImplMBean