Skip to main content

How to access servant from within the server-side object wrapper code ?

  • February 16, 2013
  • 0 replies
  • 0 views

Problem:

  • Product Name: VisiBroker for Java
  • Product Version: 4.5.1 and above
  • Component: Object Wrapper
  • Platform/OS Version: All

How to access servant from within the server-side Object Wrapper code ?

Resolution:

The following is the recommended way of accessing servant from server-side Object Wrapper (Typed) code:

// Get reference to PortableServer.Current.
Current current = (Current) this.getTarget()._orb().resolve_initial_references("POACurrent");

// Get the POA on which the object is activated and also the object_id.
POA current_poa = current.get_POA();
byte[] objId = current.get_object_id();

// Get access to the Servant (implementation object) using id_to_servant
impl = (AccountImpl) current_poa.id_to_servant(objId);


Support Case:518048

 


#Java
#VisiBroker
#ObjectWrapper
#Security