xmlBlaster 2.1.0 API

org.xmlBlaster.util.protocol.corba
Class OrbInstanceFactory

java.lang.Object
  extended by org.xmlBlaster.util.protocol.corba.OrbInstanceFactory

public final class OrbInstanceFactory
extends java.lang.Object

OrbInstanceFactory singleton to create a CORBA orb instance. Note the IANA assigned official CORBA ports:

  corba-iiop      683/tcp    CORBA IIOP 
  corba-iiop      683/udp    CORBA IIOP 
  corba-iiop-ssl  684/tcp    CORBA IIOP SSL
  corba-iiop-ssl  684/udp    CORBA IIOP SSL
  
  corbaloc        2809/tcp   CORBA LOC
  corbaloc        2809/udp   CORBA LOC
 
We use the following CORBA specific ports:
   7608 as the default port to look for a naming service
   3412 is the xmlBlaster assigned port, used for bootstrapping (optional)
 
JacORB CORBA socket:
org.jacorb.util.Environment.getProperty("OAIAddr");
org.jacorb.util.Environment.getProperty("OAPort");


Field Summary
private static boolean first
           
private static java.util.logging.Logger log
           
private static boolean nameServiceStarted
           
private static java.lang.String origORBClass
           
 
Constructor Summary
OrbInstanceFactory()
           
 
Method Summary
static MsgUnitRaw convert(Global glob, MessageUnit mu)
          Converts the internal CORBA message unit to the internal representation.
static MsgUnitRaw[] convert(Global glob, MessageUnit[] msgUnitArr)
          Converts the internal CORBA message unit array to the internal representation.
static XmlBlasterException convert(Global glob, XmlBlasterException eCorba)
          Converts the internal CORBA XmlBlasterException to the util.XmlBlasterException.
static MessageUnit convert(MsgUnitRaw mu)
          Converts the internal MsgUnitRaw to the CORBA message unit.
static MessageUnit[] convert(MsgUnitRaw[] msgUnitArr)
          Converts the internal MsgUnitRaw array to the CORBA message unit array.
static XmlBlasterException convert(XmlBlasterException eUtil)
          Converts the util.XmlBlasterException to the internal CORBA XmlBlasterException.
static org.omg.CORBA.ORB createOrbInstance(Global glob, java.lang.String[] args, java.util.Properties props, AddressBase address)
           
static java.lang.String extractHost(org.omg.CORBA.Object obj, org.omg.CORBA.ORB orb)
          Obtain the host information from the given CORBA object.
static OrbInstanceWrapper getOrbInstanceWrapper(Global glob, java.lang.String prefix)
          Get (or create) an OrbInstanceWrapper object which is useful to handle one CORBA orb instance with reference counting
static java.lang.String getString(org.omg.CosNaming.NameComponent[] nameComponent)
          Creates a string representation of a NameService name hierarchy.
private static java.util.Properties initializeOrbEnv(Global glob, AddressBase address)
          Sets the environment for CORBA.
static void startNameService(Global glob_)
          Note: This code is not yet tested to be functional (Marcel 2003-12-12)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private static java.util.logging.Logger log

first

private static boolean first

origORBClass

private static java.lang.String origORBClass

nameServiceStarted

private static boolean nameServiceStarted
Constructor Detail

OrbInstanceFactory

public OrbInstanceFactory()
Method Detail

initializeOrbEnv

private static java.util.Properties initializeOrbEnv(Global glob,
                                                     AddressBase address)
Sets the environment for CORBA.

Example for JacORB:

  org.omg.CORBA.ORBClass=org.jacorb.orb.ORB
  org.omg.CORBA.ORBSingletonClass=org.jacorb.orb.ORBSingleton
  -ORBInitRef NameService=corbaloc:iiop:localhost:7608/StandardNS/NameServer-POA/_root
 
Forces to use JacORB instead of JDK internal ORB (which is outdated) and looks for NamingService on port 7608

Parameters:
glob - Handle to access logging, properties etc.
address - The address configuration
Returns:
The used properties for the ORB

createOrbInstance

public static org.omg.CORBA.ORB createOrbInstance(Global glob,
                                                  java.lang.String[] args,
                                                  java.util.Properties props,
                                                  AddressBase address)
Parameters:
glob -
args - command line args, see org.omg.CORBA.ORB.init(), use glob.getProperty().getProperties()
props - application-specific properties; may be null, see org.omg.CORBA.ORB.init(String[], Properties)
address - The address configuration
Returns:
Access to a new created orb handle
See Also:
ORB.init(String[], Properties)

getOrbInstanceWrapper

public static OrbInstanceWrapper getOrbInstanceWrapper(Global glob,
                                                       java.lang.String prefix)
Get (or create) an OrbInstanceWrapper object which is useful to handle one CORBA orb instance with reference counting

Parameters:
glob -
prefix - A unique identifier for the orb, using the same prefix will return the same orb on second and further calls

extractHost

public static java.lang.String extractHost(org.omg.CORBA.Object obj,
                                           org.omg.CORBA.ORB orb)
Obtain the host information from the given CORBA object. This is accomplished by parsing the object's IOR using CORBA classes org.omg.IOP.IORHelper and org.omg.IIOP.ProfileBody_1_1Helper. Consequently, CORBA version is 2.x (or higher) is required.

Parameters:
obj - the CORBA object to interrogate
orb - the ORB to use during interrogation

startNameService

public static void startNameService(Global glob_)
Note: This code is not yet tested to be functional (Marcel 2003-12-12)


convert

public static final MsgUnitRaw convert(Global glob,
                                       MessageUnit mu)
                                throws XmlBlasterException
Converts the internal CORBA message unit to the internal representation.

Throws:
XmlBlasterException

convert

public static final MessageUnit convert(MsgUnitRaw mu)
Converts the internal MsgUnitRaw to the CORBA message unit.


convert

public static final XmlBlasterException convert(Global glob,
                                                XmlBlasterException eCorba)
Converts the internal CORBA XmlBlasterException to the util.XmlBlasterException.


convert

public static final XmlBlasterException convert(XmlBlasterException eUtil)
Converts the util.XmlBlasterException to the internal CORBA XmlBlasterException.


convert

public static final MsgUnitRaw[] convert(Global glob,
                                         MessageUnit[] msgUnitArr)
                                  throws XmlBlasterException
Converts the internal CORBA message unit array to the internal representation.

Throws:
XmlBlasterException

convert

public static final MessageUnit[] convert(MsgUnitRaw[] msgUnitArr)
Converts the internal MsgUnitRaw array to the CORBA message unit array.


getString

public static java.lang.String getString(org.omg.CosNaming.NameComponent[] nameComponent)
Creates a string representation of a NameService name hierarchy. This is useful for logging

Returns:
e.g. "xmlBlaster.MOM/heron.MOM"

xmlBlaster 2.1.0 API

Copyright © 1999-2011 The xmlBlaster.org contributers.