-r option to the run script to allow a soft real-time client to call onto the OpenFusion CORBA Services (RTJ#1037).
When a real-time POA is configured with a ThreadpoolPolicy, it uses an internal reader thread to read requests. The priority of this reader thread is now set equal to the highest priority thread in the threadpool.
-ORBListenEndpoints and
ofj.etf.listen-on-all-interfaces has been altered (RTJ#1019):
ofj.etf.listen-on-all-interfaces property is set (this is the default),
it is possible to specify the port or port range on which the interfaces are to listen by
supplying a single -ORBListenEndpoints argument.
When ofj.etf.listen-on-all-interfaces is not set, a single
-ORBListenEndpoints argument can be used to set the port or port range on
which the default interface will listen.
If an ORB is created using a -ORBListenEndpoints argument with a host:port
combination this will override the ofj.etf.listen-on-all-interfaces property.
The Root POA is configured via OFJ properties or arguments.
If the ofj.etf.listen-on-all-interfaces property is set (the default case),
the Root POA will listen on all available interfaces. If not, it will
listen on the interface named by the default-host property if set,
or the first non-loopback interface if default-host is not set.
Alternatively one or more -ORBListenEndpoints <argval>
arguments can be given. Each argument specifies one interface to listen on. The
format of <argval> is:
<argval> := <hostname>:<portspec> | <portspec>
<portspec> := <portnum> | <portnum>,<portnum>
<hostname> := a textual host name | a dotted decimal IP address
<portnum> := an integer
A child POA will use the RootPOA's listeners unless it has been created with a Server Protocol Policy. This policy will contain one or more Protocols, each of which will specify an interface on which the child POA will listen. Child POAs do not inherit listeners from parent POAs.
The OFJ property allow-localhost is no longer needed and has
been removed.
The attributes listen-on-all-interfaces and
allow-localhost have been removed from OFJTCPProtocolProperties.
There are a number of new properties to control these options:
ofj.log.timestamp:
ofj.log.timestamp-format:
SEND_REPLY or SEND_EXCEPTION points on the server side will not get called if a call is invoked on a local server. This will result in a BAD_INV_ORDER exception when trying to access attributes that are not available because the call status has not been set to send_reply or send_exception.
servant_previnoke (and so the ServantObject is null) a CORBA.UNKNOWN exception will be thrown with the message "local invocations not supported";.
__default(_discriminator) method (JAC#565).
ofj.etf.default-no-delay property
from false to true to disable Nagle's Algorithm.
ofj.etf.use-names (defaults to false).
ofj.etf.listen-on-all-interfaces (defaults to true).
ofj.etf.default-host (defaults to the empty string).
ofj.etf.allow-localhost (defaults to false).
ofj.etf.listen-on-all-interfaces property is set to false, the ORB will choose to listen on a non-loopback interface if one is available, or the loopback interface if not. The chosen address will be used in IOR profiles.ofj.etf.listen-on-all-interfaces property is set to false, and the ofj.etf.default-host property is set to a hostname or address, the ORB will choose that interface to listen on and to use in IOR profiles.ofj.etf.allow-localhost property is set to false, and the ofj.etf.default-host property is set to 127.0.0.1, the ORB will convert this into the address of a non-loopback interface.ofj.etf.use-names property is set to true, the ORB will attempt to use a textual hostname (as opposed to a numeric IP address) in IOR profiles.ofj.etf.connect-timeout property added (RTJ#917).
java.lang.Integer.MAX_VALUE.
genEnhanced and char sequence (JAC#617).
Install type panel of the Graphical
Installer or via the command line as:
java Setup <install_dir> "OpenFusion RTOrb Java Deployment Kit"
[RTORB] (RTJ#770).
com.prismtech.ofj.orb.InputStream and com.prismtech.ofj.orb.OutputStream). These classes provide methods to allow CDR encoding into a buffer supplied by the user application and the ability to control at which offset in the buffer the encoding starts. For more information, see Appendix A of the Product Guide (RTJ#723).
run and runrt scripts (RTJ738).
ofj.properties file to state the order in which RTOrb
looks for properties (RTJ744).
ofj.etf.server.reuseAddress property added. If set, this allows applications
to enable the SO_REUSEADDR socket option. Applications can bind to a TCP socket
even if a previous connection to the socket is in a timeout state (RTJ717).
ofj.etf.default-port_low or
ofj.etf.default-port_high to less than 0, when a server shuts
down and restarts immediately, RTOrb will select an ephemeral port assigned
by the machine's IP stack. Otherwise, RTOrb assigns the lowest port
number not in use within the specified range (RTJ698).
-ORBListenEndpoints has been
implemented. The format for this argument is proprietary (as defined
in 04-03-12 section 4.5.1.2). It is:
-ORBListenEndpoints <integer>
-ORBListenEndpoints <port min integer>,<port max integer>
This overrides the ofj.etf.default-port_low /
ofj.etf.default-port_high defined in the ofj.properties file (RTJ692).
com.prismtech.ofj.util.ClassInitializer.init()org.omg.CORBA.CustomMarshal interface.
ofj.global.rtmode property has now been removed.
ofj.orb_initializer.fail_on_error property has been ported from JacORB. This, if turned on, will throw INITIALIZE if ORBInitializers throw exceptions. It defaults to off.
ofj.messaging.syncnone properties have changed and a warn message is displayed when trying to send SYNC_NONE requests with the number of sync_none threads set to 0 (RTJ608):
The new default values are:
ofj.messaging.syncnone.threads=5
ofj.messaging.syncnone.priority=16384
structs and
unions in the skeleton classes (RTJ529). This utilises version 2.3.0.1 of the JacORB idl compiler (V070207).
Using the object cache is a two stage process:
-cacheplugin argument to
generate object caching code, for example:
idl -d generated -cacheplugin com.prismtech.ofj.util.objectcache.ObjectCachePluginImplementation myIdl.idl
structs
and unions and in the skeleton classes of interfaces.
ofj.objectcache.cachedObjectClasses (mandatory, no default. A comma-delimited list of class names to be managed by object caches)
ofj.objectcache.<classname>.cacheClass (optional, default com.prismtech.ofj.util.objectcache.ObjectCacheImplementation. The class name of the object cache implementation.
ofj.objectcache.<classname>.initialSize (optional, default 0. The initial number of objects an object cache contains)
ofj.objectcache.<classname>.growByAmount (optional, default 1. The number of objects allocated at the same time if the cache is empty but the maximumSize has not been reached)
ofj.objectcache.<classname>.maximumSize (options, default 128. The maximum number of objects allocated by the cache)
where the value of <classname> should be set to:
ofj.objectcache.mypackage.MyStruct.initialSize=0 ORdefault- to define a property value for all object cache instances, for example, ofj.objectcache.default-initialSize=0The RTOrb object cache implementation allows you to easily replace the default implementations of ObjectCache and ObjectCachePlugin with a custom object cache implementation.
The ofj.rtmode property
To create ORBs in different modes within the same JVM, use the
ofj.rtmode property. You can create different ORBs inline in the
code by using a combination of the org.omg.CORBA.ORBClass
and ofj.rtmode properties and passing these arguments to
ORB.init. For example:
Enterprise mode:
Properties props = new Properties ();
props.put ("org.omg.CORBA.ORBClass", "com.prismtech.ofj.orb.ORB");
props.put ("org.omg.CORBA.ORBSingletonClass", "com.prismtech.ofj.orb.ORBSingleton");
Soft real-time mode:
Properties props = new Properties ();
props.put ("org.omg.CORBA.ORBClass", "com.prismtech.ofj.rtorb.RTORB");
props.put ("org.omg.CORBA.ORBSingletonClass", "com.prismtech.ofj.orb.ORBSingleton");
props.put ("ofj.rtmode", "soft");
Hard real-time mode:
Properties props = new Properties ();
props.put ("org.omg.CORBA.ORBClass", "com.prismtech.ofj.rtorb.RTORB");
props.put ("org.omg.CORBA.ORBSingletonClass", "com.prismtech.ofj.orb.ORBSingleton");
props.put ("ofj.rtmode", "hard");
The ofj.global.rtmode property
This functionality is used internally for cache allocations
and is only required for real-time platforms.
If you are using a non real-time platform,
global mode is always set to Enterprise and cannot be influenced by the
ofj.global.rtmode JVM property.
If you are using a real-time platform,
the ofj.global.rtmode JVM property has a default value of soft.
Note that if hard real-time is required in the same JVM as another type of ORB,
currently you must pass ofj.global.rtmode=hard to the JVM properties.
If you do not pass ofj.global.rtmode as a JVM property, as a fallback
mechanism, RTOrb sets the value of this property to hard if it detects that
the value of the property ofj.rtmode is hard,
or if it detects that the current thread is a NoHeapRealtimeThread.
For this scenario using hard real-time, the ORB currently allocates more internal
structures within Immortal memory, even if soft or enterprise ORBs are being used.
Conversely, if just soft or enterprise mode is being used, then the ORB utilises
only Heap memory.
If PrismTech supplied OMG stubs (for example, org.omg.CORBA.ORB) are not used when running an application, this may result in undefined behaviour. For example, the PrismTech defined OMG stubs create the Singleton ORB implicitly in Immortal Memory by defining and initialising the static reference immediately. Supplied OMG code within JDKs may not do this.
OFJ<n>
where <n> is an integer which starts at 0 and is incremented for each default id (RTJ558).
com.prismtech.ofj.orb.Messaging.Messaging.Configure () method
to make Messaging active. Messaging can now be configured using the
ofj.properties file (RTJ541).
The properties, with default values, are:
ofj.messaging.syncnone.threads=0
ofj.messaging.syncnone.priority=0
ofj.messaging.poll.priority=16384
ofj.messaging.async.priority=16384
ofj.messaging.async.min.threads=0
ofj.messaging.async.max.threads=4
ofj.messaging.async.peak.threads=8
ofj.messaging.async.stacksize=65536
org.omg.CORBA.SystemExceptionHelper class added. This class includes an
extract () method, which takes an Any and returns a SystemException (RTJ537).
OutputStream.size () method added to obtain the size of the OutputStream (RTJ546).
ORB.init
returned the same ORB instance and not a new, fully functional ORB instance (RTJ487).
Now, RTOrb supports multiple ORBs of the same type, i.e. enterprise, soft real-time or hard real-time in a single JVM for the following functional areas:
ORBInitInfo
setLittleEndian method on the CDRInputStream class. JacORB's CDROutputStream also
has a method to retrieve a copy of the current buffer via the getBufferCopy method.
setLittleEndian can be called on the InputStream class (RTJ486) and
getBufferCopy can be called on the OutputStream class
com.prismtech.ofj.orb.InputStream (org.omg.CORBA.ORB orb)com.prismtech.ofj.orb.InputStream (org.omg.CORBA.ORB orb, byte[] buffer)com.prismtech.ofj.orb.OutputStream (org.omg.CORBA.ORB orb)Example of usage:
org.omg.CORBA.ORB orb = ...
byte[] buf = ...
com.prismtech.ofj.orb.InputStream inputStream =
new com.prismtech.ofj.orb.InputStream (orb, buf);
inputStream.setLittleEndian (booleanValue);
String stringValue = inputStream.read_string ();
org.omg.CORBA.ORB orb = ...
com.prismtech.ofj.orb.OutputStream outputStream =
new com.prismtech.ofj.orb.OutputStream (orb);
outputStream.write_string (someString);
byte[] buf = new byte[outputStream.size ()];
org.omg.CORBA.ORB orb = ...
com.prismtech.ofj.orb.OutputStream bitBucket =
new com.prismtech.ofj.orb.OutputStream (orb);
bitBucket.write_any (corbaAnyA);
com.prismtech.ofj.orb.InputStream bitSpout =
new com.prismtech.ofj.orb.InputStream (myOrb, bitBucket.getBufferCopy () );
corbaAnyB = bitSpout.read_any ();
Note: The ORB parameter in the above examples is mandatory.
ORB.init () (RTJ545).
OFJTCPProtocolProperties pp1 = (OFJTCPProtocolProperties)
rtORB.create_tcp_protocol_properties (1024, // send_buffer_size
1024, // recv_buffer_size
false, // keep_alive
false, // dont_route
false); // no_delay
pp1.port_range_low (16200);
pp1.port_range_high (16201);
Protocol prot = new Protocol ();
prot.protocol_type = Iop.TAG_INTERNET_IOP;
prot.orb_protocol_properties = null;
prot.transport_protocol_properties = pp1;
Protocol [] prots = new Protocol [1];
prots[0] = prot;
ServerProtocolPolicy spp1 = rtORB.create_server_protocol_policy (prots);
Policy pList1[] = new Policy[3] ;
pList1[0] = threadpoolPolicy ;
pList1[1] = pbcPolicy ;
pList1[2] = spp1;
POA child1POA = (POA)rtRootPOA.create_POA( "Child1",
rtRootPOA.the_POAManager(),
pList1 ) ;
create_tcp_protocol_properties operation requires the TCP parameters
to be explicitly set, so if you want to use the platform defaults, you have to find out
what they are and set them. To help with this, the utility NetworkInfo can
be used to discover the interfaces and their default settings. Invoke it like this:
<rtorb_install_dir>/bin/run com.prismtech.ofj.util.NetworkInfo
Unless overriden by properties or protocol policies, the ORB listens on a hostname found by listing the addresses of all network interfaces and picking the first one which is not localhost. If one cannot be found, then localhost (127.0.0.1) is used.
etc/Poas file and supporting code to associate POA names with TCP ports
has been replaced by the mechanism described above.
Essentially, 'localhost' is another network interface and is treated as such.
localhost can be used as a shorthand name for a machine when using a corbaloc
URL on the client side. In terms of RTOrb, this means that the client attempts
to connect to the localhost (loopback) interface. This is a separate
interface to the machine's actual named network interface, for example,
amd1.prismtech.com. Therefore, unless the server has been configured to
listen on the localhost interface on the same machine (via the
ofj.etf.default-host property or protocol policies on POAs)
then the client will fail to connect.
Setting the ofj.etf.allow-localhost property to false by default
means that if you use a corbaloc URL with localhost on the client side, this
will automatically be transformed to use the actual machine name. Therefore,
the client will successfully connect to the server. For the majority of situations
where the server has been run with default settings, this enables clients
to connect to the server regardless of their corbaloc URL configuration.
Starting a server to listen on localhost (and therefore write localhost
into the IOR) is not recommended practice as the IOR is no longer portable
and may lead to unexpected results if it is ever transferred to another
machine. For that reason the use of client-side corbalocs with
localhost is not recommended either; the ofj.etf.allow-localhost
property is an RTOrb QoS that allows client-side corbalocs to work transparently
in this scenario.
This does require the IDL stubs to be regenerated with the latest IDL compiler.
addObjectKey proprietary function added (RTJ452).