public class JacORBConfiguration extends Object implements Configuration
Modifier and Type | Field and Description |
---|---|
static boolean |
useTCCL
useTCCL controls which class loader policy JacORB should use throughout
the codebase. |
Modifier and Type | Method and Description |
---|---|
String |
getAttribute(String key)
Gets the attribute
|
String |
getAttribute(String key,
String defaultValue)
getAttribute
|
boolean |
getAttributeAsBoolean(String key,
boolean defaultValue)
Return the attribute as a boolean.
|
double |
getAttributeAsFloat(String key,
double defaultValue)
Returns the value of the configuration attribute with the given key,
as a float value.
|
int |
getAttributeAsInteger(String key)
Validates the key exists and then returns the value.
|
int |
getAttributeAsInteger(String key,
int defaultValue)
Gets the attribute as integer.
|
int |
getAttributeAsInteger(String key,
int defaultValue,
int radix)
Returns the integer value of the specified key.
|
long |
getAttributeAsLong(String key,
long defaultValue)
Gets the attribute as long.
|
Object |
getAttributeAsObject(String key)
Gets the attribute as object.
|
Object |
getAttributeAsObject(String key,
String defaultClass)
Gets the attribute as object.
|
String[] |
getAttributeAsStringsArray(String key)
For a property that has a list of comma-separated values,
this method returns these values as a array of Strings.
|
List<String> |
getAttributeList(String key)
Gets the attribute list.
|
List<String> |
getAttributeNamesWithPrefix(String prefix)
Gets the attribute names with prefix.
|
static Configuration |
getConfiguration(Properties props,
ORB orb,
boolean isApplet)
Factory method.
|
static Configuration |
getConfiguration(Properties props,
ORB orb,
String orbid,
boolean isApplet)
Factory method.
|
org.slf4j.Logger |
getLogger(String name)
Returns a Logger that logs JacORB system messages.
|
ORB |
getORB()
Gets the ORB.
|
boolean |
isAttributeSet(String key)
Returns if the configuration attribute with the given key is defined.
|
void |
setAttribute(String key,
int value)
Sets the given int attribute with the given value
|
void |
setAttribute(String key,
String value)
Sets the value of a single attribute.
|
void |
setAttributes(Properties properties)
set attributes of this configuration using properties.
|
void |
shutdownLogging()
Calls shutdown on the logging sub-system.
|
public static final boolean useTCCL
useTCCL
controls which class loader policy JacORB should use throughout
the codebase. By default it will attempt to load using the Thread Context Class Loader.
To support integration in some deployment scenarios it is also possible to use Class.forName.
This may be set by setting jacorb.classloaderpolicy system property to either tccl or forname.
Note that this is duplicated within org.omg.CORBA.ORBSingleton
(to avoid cross-dependencies)public static Configuration getConfiguration(Properties props, ORB orb, boolean isApplet) throws ConfigurationException
props
- the propsorb
- the orbisApplet
- the is appletConfigurationException
- the configuration exceptionpublic static Configuration getConfiguration(Properties props, ORB orb, String orbid, boolean isApplet) throws ConfigurationException
props
- the propsorb
- the orborbid
- the orb_id (if set)isApplet
- the is appletConfigurationException
- the configuration exceptionpublic void setAttribute(String key, String value)
setAttribute
in interface Configuration
key
- the keyvalue
- the valuepublic void setAttribute(String key, int value)
Configuration
setAttribute
in interface Configuration
public void setAttributes(Properties properties)
setAttributes
in interface Configuration
properties
- the new attributespublic void shutdownLogging()
public ORB getORB()
getORB
in interface Configuration
public org.slf4j.Logger getLogger(String name)
The JacORB root logger is named "jacorb". Sublogger names all
start with this prefix. If the property jacorb.implname is set,
and the property jacorb.log.split_on_implname is true, then
all loggers for that particular ORB instance are rooted in
jacorb.<implname>
Here's a guideline how to use logging levels in the code:
error Conditions that indicate a bug in JacORB or user code, or a wrong configuration. This includes, but is not limited to, errors that will lead to termination of the program (fatal errors).
warn Conditions that demand attention, but are handled properly according to the CORBA spec. For example, abnormal termination of a connection, reaching of a resource limit (queue full).
info Start/stop of subsystems, establishing and closing of connections, registering objects with a POA.
debug Information that might be needed for finding bugs in JacORB or user code. Anything that relates to the normal processing of individual messages should come under this level. For each CORBA message, there should at least one debug message when subsystem boundaries are crossed (e.g. GIOPConnection -> POA -> User Code).
getLogger
in interface Configuration
name
- the namepublic boolean isAttributeSet(String key) throws ConfigurationException
Configuration
isAttributeSet
in interface Configuration
ConfigurationException
public String getAttribute(String key) throws ConfigurationException
getAttribute
in interface Configuration
key
- the keyConfigurationException
- the configuration exceptionConfiguration.getAttribute(java.lang.String)
public String getAttribute(String key, String defaultValue)
getAttribute
in interface Configuration
Configuration.getAttribute(java.lang.String, java.lang.String)
public int getAttributeAsInteger(String key, int defaultValue) throws ConfigurationException
getAttributeAsInteger
in interface Configuration
key
- the keydefaultValue
- the default valueConfigurationException
- the configuration exceptionConfiguration.getAttributeAsInteger(java.lang.String, int, int)
public int getAttributeAsInteger(String key, int defaultValue, int radix) throws ConfigurationException
getAttributeAsInteger
in interface Configuration
key
- the keydefaultValue
- the default valueradix
- the radixConfigurationException
- the configuration exceptionpublic int getAttributeAsInteger(String key) throws ConfigurationException
getAttributeAsInteger
in interface Configuration
key
- the keyConfigurationException
- the configuration exceptionpublic long getAttributeAsLong(String key, long defaultValue) throws ConfigurationException
getAttributeAsLong
in interface Configuration
key
- the keydefaultValue
- the default valueConfigurationException
- the configuration exceptionConfiguration.getAttributeAsLong(java.lang.String, long)
public List<String> getAttributeList(String key)
getAttributeList
in interface Configuration
key
- the keyConfiguration.getAttributeList(java.lang.String)
public String[] getAttributeAsStringsArray(String key)
Configuration
getAttributeAsStringsArray
in interface Configuration
public Object getAttributeAsObject(String key) throws ConfigurationException
getAttributeAsObject
in interface Configuration
key
- the keyConfigurationException
- the configuration exceptionConfiguration.getAttributeAsObject(java.lang.String)
public Object getAttributeAsObject(String key, String defaultClass) throws ConfigurationException
getAttributeAsObject
in interface Configuration
key
- the keydefaultClass
- the default classConfigurationException
- the configuration exceptionConfiguration.getAttributeAsObject(java.lang.String, java.lang.String)
public boolean getAttributeAsBoolean(String key, boolean defaultValue)
getAttributeAsBoolean
in interface Configuration
key
- the keydefaultValue
- the default valuepublic List<String> getAttributeNamesWithPrefix(String prefix)
getAttributeNamesWithPrefix
in interface Configuration
prefix
- the prefixConfiguration.getAttributeNamesWithPrefix(java.lang.String)
public double getAttributeAsFloat(String key, double defaultValue) throws ConfigurationException
Configuration
getAttributeAsFloat
in interface Configuration
ConfigurationException
Copyright © 2017 JacORB. All rights reserved.