public class NumberGenerator extends AbstractNumberGenerator implements NumberGeneratorIF, java.lang.Runnable
Property Keyword | Datatype | Default | Description |
---|---|---|---|
NameServiceName | String | NameService | The name of the requested CORBA Name Service. This value is an application property. |
NameServicePort | String | 2809 | The port number of the requested CORBA Name Service. This value is an application property. |
NameServiceHost | String | localhost | The host name of the requested CORBA Name Service. This value is an application property. |
CORBAProtocol | String | "" | The CORBA protocol in the corbaloc (CORBA locator) to find the name service. The default of CORBA is iiop, which is identical with an empty string "". For IIOP over SSL the protocol must be ssliop. This value is an application property. It is ignored if ORBInitRef is set. |
ORBInitRef | String | none | The full corbaloc (CORBA locator). If this value is set, the values of NameServiceName, NameServicePort, NameServiceHost and CORBAProtocol are ignored. This value is an application property. Example: NameService=corbaloc::1.2@MyServiceHost:MyServicePort/NameService |
ORBProperty[???] | String | null | An ORB property. The property name of the property is defined in the brackets. Example: ORBProperty[com.sun.CORBA.codeset.charsets]=0x05010001, 0x00010109 ORBProperty[com.sun.CORBA.codeset.wcharsets]=0x00010109, 0x05010001 |
ServiceName | String | NumberGenerator | The service to be used by the service. This value is an application property. |
PrintNameServiceIOR | boolean | false | This flags tells the server to print the NameService IOR to the console. This IOR can be used by the client to find the name service used by service. |
NameServiceContext | string | "com/highqsoft/" | This property set the name service context. The name service context is the context in which servicename will be published. The conext must ends with '/' character. |
DebugLevel | int | none | To get verbose output set this value. Currently there is no convention at what is printed at what level. |
StdOut | File | none | The name of a file that service uses as standard output stream. This value can not set via a property files (parameter Properties), because it will be used directly after startup and before the property file is evaluated. |
StdErr | File | none | The name of a file that service uses as standard error stream. This value can not set via a property files (parameter Properties), because it will be used directly after startup and before the property file is evaluated. |
ConfigFile | XML File | none / required | The name of the XML configuration file. |
Properties | filename | none | A file that contains the properties. The properties defined directly as parameters have higher priority. |
,
Serialized FormModifier and Type | Class and Description |
---|---|
protected static class |
NumberGenerator.RunningStateListener
The service listener to control the state of the command line ver
|
Modifier and Type | Field and Description |
---|---|
protected java.lang.String[] |
args |
static java.lang.String |
version |
Constructor and Description |
---|
NumberGenerator()
The constructor.
|
NumberGenerator(java.lang.String[] args)
Constructor receiving the commandline arguments.
|
Modifier and Type | Method and Description |
---|---|
void |
addJVMServiceListener(JVMServiceListener l)
Add a service state listener.
|
protected void |
err(java.lang.String s)
The output on standard err.
|
boolean |
exit()
The exit method.
|
void |
fireServiceEvent(int state)
Fire a service event.
|
void |
fireServiceEvent(int state,
java.lang.String message)
Fire a service event.
|
void |
fireServiceEvent(JVMServiceEvent ev)
Fire a service event.
|
int |
generate(java.lang.String namespace)
Generate a long value belongs to the given namespace.
|
static NumberGenerator |
getInstance()
Get the NumberGenerator instance.
|
JVMServiceListener[] |
getJVMServiceListeners()
Get all service state listeners.
|
java.lang.String |
getVersion() |
void |
init()
Initialize NumberGenerator.
|
boolean |
isRunning()
Get the running state.
|
static void |
main(java.lang.String[] args)
Main module of this application.
|
protected void |
out(java.lang.String s)
The output on standard out.
|
void |
removeJVMServiceListener(JVMServiceListener l)
Remove a service state listener.
|
void |
reset(java.lang.String namespace)
Reset the generation counter and will set the current count to zero.
|
void |
resetToValue(java.lang.String namespace,
int value)
Reset the generation counter and set the current value to the given value.
|
void |
restart()
Restart NumberGenerator.
|
void |
run()
Run the application.
|
void |
scheduleStop()
Schedule a server stop.
|
static void |
setOutputStreams(java.lang.String[] args)
Analize the arguments for StdOut and StdErr keywords and set the system out and err stream.
|
void |
terminate(boolean orbStarted)
Terminate process.
|
protected void |
writeConfiguration() |
_create_request, _create_request, _duplicate, _get_domain_managers, _get_policy, _hash, _is_a, _is_equivalent, _non_existent, _release, _request, _set_policy_override
_all_interfaces, _invoke, _this, _this
_default_POA, _get_delegate, _get_interface_def, _object_id, _orb, _poa, _set_delegate, _this_object, _this_object
public static final java.lang.String version
protected java.lang.String[] args
public NumberGenerator()
public NumberGenerator(java.lang.String[] args)
args
- the command line arguments.public java.lang.String getVersion()
public void addJVMServiceListener(JVMServiceListener l)
l
- the service state listener to be added.public void removeJVMServiceListener(JVMServiceListener l)
l
- the service state listener to be removed.public JVMServiceListener[] getJVMServiceListeners()
public void fireServiceEvent(int state, java.lang.String message)
- public void fireServiceEvent(int state)
- public void fireServiceEvent(JVMServiceEvent ev)
- public static NumberGenerator getInstance()
public void scheduleStop()
public boolean isRunning()
public void run()
run
in interface java.lang.Runnable
public void terminate(boolean orbStarted)
public void init()
public boolean exit()
public void restart()
public static void setOutputStreams(java.lang.String[] args)
args
- The startup arguments.protected void writeConfiguration() throws NumberGeneratorException
NumberGeneratorException
public int generate(java.lang.String namespace) throws NumberGeneratorException
generate
in interface NumberGeneratorIFOperations
namespaced
- the name space that should be used for number generation.NumberGeneratorException
- with the following possible error codes:
NUMBERGENERATOR_BAD_PARAMETER
NUMBERGENERATOR_IMPLEMENTATION_PROBLEM
NUMBERGENERATOR_NOT_IMPLEMENTED
NUMBERGENERATOR_NO_MEMORYpublic void reset(java.lang.String namespace) throws NumberGeneratorException
reset
in interface NumberGeneratorIFOperations
namespaced
- the name space that should be reset.NumberGeneratorException
- with the following possible error codes:
NUMBERGENERATOR_BAD_PARAMETER
NUMBERGENERATOR_IMPLEMENTATION_PROBLEM
NUMBERGENERATOR_NOT_IMPLEMENTED
NUMBERGENERATOR_NO_MEMORYpublic void resetToValue(java.lang.String namespace, int value) throws NumberGeneratorException
resetToValue
in interface NumberGeneratorIFOperations
namespaced
- the name space that should be reset.value
- the new counter setting.NumberGeneratorException
- with the following possible error codes:
NUMBERGENERATOR_BAD_PARAMETER
NUMBERGENERATOR_IMPLEMENTATION_PROBLEM
NUMBERGENERATOR_NOT_IMPLEMENTED
NUMBERGENERATOR_NO_MEMORYprotected void out(java.lang.String s)
protected void err(java.lang.String s)
public static void main(java.lang.String[] args)