Skip to main content

What are CORBA Callbacks

  • May 17, 2013
  • 0 replies
  • 0 views

Summary This article describes how and when CORBA Callbacks should be used and the advantages and disadvantages they offer.
Article Number 19429
Environment Orbix 6.3 All Supported Operating Systems
Question/Problem Description What is a CORBA Callback?
How to implement callback operations in Orbix.
Implementing CORBA Callbacks.
Advantages to CORBA Callbacks.
Clarifying Information
Error Message
Defect/Enhancement Number
Cause A typical CORBA exchange involves Application A (The client) invoking an operation on Application B (The server). The operation blocks until Application B returns a result, or an exception is thrown.

In certain circumstances, it may be preferable for Application A to invoke an operation on Application B, but for this call not to block. Instead Application B could reestablish a connection to Application A and push back its reply. This approach is called a "CORBA Callback".

In the above example, Application B takes on the role of a client, while Application A takes on that of a server.
Resolution
CORBA Callback objects are implemented on a client in exactly the same was as CORBA objects are on a server.

CORBA Callback objects are activated in a client-side POA (Please see the section “Activating CORBA Objects” in our CORBA Programmers Guide). 

The CORBA Callback object's POA’s life-span policy should be set to TRANSIENT. Thus, all object references that the POA exports are valid only as long as the POA is running. This ensures that a late server callback is not misdirected to another client after the original client shuts down.

As the root POA always exports transient object references, it may be appropriate to use a client’s root POA for callback objects. Using this approach, it is important to ensure the callback code is thread-safe, otherwise, the POA should be created with "SINGLE_THREAD_MODEL" and "TRANSIENT" policies.
Workaround
Notes For further details on implementing CORBA Callback objects, please see the section entitled "Implementing Callback Objects" in the Orbix Programmer's Guides.
Attachment
Created date: 06 September 2011
Last Modified: 13 February 2013
Last Published: 23 June 2012
First Published date: 10 September 2011

#KnowledgeDocs
#Orbix