background image
Bionic Buffalo Tech Note #25: Quick Start Guide to Writing CORBA Server Applications
 
If an application invokes either 
servant_to_id() or servant_to_reference
() to create an object id or object reference for use with a given servant, and if the
specified servant is not active, having 
ImplicitActivationPolicy set to
IMPLICIT_ACTIVATION will cause the POA to activate the specified servant. This
only applies when the 
RETAIN and SYSTEM_ID policy values are in effect. 
Use of 
IMPLICIT_ACTIVATION is mostly a convenience for application developers,
since, regardless of the value of the 
ImplicitActivationPolicy, activation can be
done explicitly by the application. 
ThreadPolicy 
The 
ThreadPolicy specifies the thread model and reentrancy of the servants. It only
matters in multithreaded environments. 
 
If the value is 
ORB_CTRL_MODEL, the servants are presumed to be thread aware and
reentrant. A 
POA may simultaneously call the same servant from different threads. 
 
If the value is 
SINGLE_THREAD_MODEL, the POA will call the servants from only
one thread at a time. This is for servants which are non-reentrant or not thread aware. 
 
The 
MAIN_THREAD_MODEL value is used for some environments which distinguish a
special “main thread” from other threads. (Examples include DOS and some RTOS
environments.) With this policy value, not only are all calls made from a single thread,
but that thread always will be the distinguished, “main” thread. 
ThreadPolicy is simply an indication whether the servants are reentrant and
thread aware, and whether they must executed only on a special main or
distinguished thread in certain environments.
 
Note that 
ThreadPolicy applies not only to servants, but also to servant managers, if
any.
Creating and Advertising Object References
 
From an application standpoint, object references are created by 
POAs. Object references may be
created by any application which has an object reference for the 
POA (and maybe for the servant)
which will handle the object's requests. Although there are some other ways in which objects might
come into existence (implicit activation, and so on), this Tech Note will limit discussion to the four
basic 
POA operations that most applications will invoke. 
 
 
create_reference() and create_reference_with_id() will create and return new
object references. The first is used when the 
SYSTEM_ID policy value applies, and the other is
used when the 
USER_ID policy value applies. These operations do not associate the new references
with specific servants. 
 
 
activate_object() and activate_object_with_id() will create new objects
Page 6 of 12