org.objectweb.david.libs.binding.moa
Class MOAImpl

java.lang.Object
  extended byorg.omg.CORBA.portable.ObjectImpl
      extended byorg.objectweb.david.apis.binding.simpleoa._SimpleAdapterImplBase
          extended byorg.objectweb.david.libs.binding.moa.MOAImpl
All Implemented Interfaces:
org.omg.CORBA.portable.IDLEntity, org.omg.CORBA.portable.InvokeHandler, org.omg.CORBA.Object, java.io.Serializable, SimpleAdapter, SimpleAdapterOperations

public class MOAImpl
extends _SimpleAdapterImplBase

Encapsulates a MinimalAdapter instance under a CORBA compliant interface, by implementing SimpleAdapter.

SimpleAdapter is a very simple adapter type, providing operations to export and unexport CORBA objects. The methods of MOAImpl implementing the effective functionalities of SimpleAdapter delegate to an underlying adapter of type MinimalAdapter, possibly used by different personnalities.

An object adapter is only responsible for the identification and activation of servant objects: The code of an object adapter has thus no reason to deal with other problems such as distribution. However, it is convenient, when exporting an object, to have it also exported to a naming context that will deal with distribution aspects. MOAImpl lets a default naming context be used, or alternatively, a specific naming context be specified at export time.

See Also:
Serialized Form

Field Summary
protected  NamingContext nc
          The naming context responsible for distribution handling.
 
Constructor Summary
MOAImpl(NamingContext orb, DelegateFactory dfactory, MinimalAdapter adapter, org.objectweb.jonathan.apis.kernel.ContextFactory context_factory)
           
 
Method Summary
 void export(org.omg.CORBA.Object impl)
          Exports a CORBA object to the target adapter.
 void export(org.omg.CORBA.portable.ObjectImpl impl, org.objectweb.jonathan.apis.kernel.Context hints, NamingContext nc)
          Exports a CORBA object implementation to the target adapter, and recursively to the provided naming context.
 void exportWithPort(org.omg.CORBA.Object impl, int port)
          Exports a CORBA object to the target adapter, using the specified TCP port.
 void unexport(org.omg.CORBA.Object impl)
          Unexports the provided CORBA object.
 
Methods inherited from class org.objectweb.david.apis.binding.simpleoa._SimpleAdapterImplBase
_getMethodSwitchKey, _ids, _invoke, _setContinuation
 
Methods inherited from class org.omg.CORBA.portable.ObjectImpl
_create_request, _create_request, _duplicate, _get_delegate, _get_domain_managers, _get_interface_def, _get_interface, _get_policy, _hash, _invoke, _is_a, _is_equivalent, _is_local, _non_existent, _orb, _release, _releaseReply, _request, _request, _servant_postinvoke, _servant_preinvoke, _set_delegate, _set_policy_override, equals, hashCode, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.omg.CORBA.Object
_create_request, _create_request, _duplicate, _get_domain_managers, _get_interface_def, _get_interface, _get_policy, _hash, _is_a, _is_equivalent, _non_existent, _release, _request, _set_policy_override
 

Field Detail

nc

protected NamingContext nc
The naming context responsible for distribution handling.

Constructor Detail

MOAImpl

public MOAImpl(NamingContext orb,
               DelegateFactory dfactory,
               MinimalAdapter adapter,
               org.objectweb.jonathan.apis.kernel.ContextFactory context_factory)
Method Detail

export

public void export(org.omg.CORBA.Object impl)
Exports a CORBA object to the target adapter.

This method calls the export method of 3 arguments. The second argument is a Integer instance of value 0.

Specified by:
export in interface SimpleAdapterOperations
Overrides:
export in class _SimpleAdapterImplBase

exportWithPort

public void exportWithPort(org.omg.CORBA.Object impl,
                           int port)
Exports a CORBA object to the target adapter, using the specified TCP port.

This method calls the export method of 3 arguments. The second argument is a Integer instance of value port.

Specified by:
exportWithPort in interface SimpleAdapterOperations
Overrides:
exportWithPort in class _SimpleAdapterImplBase
Parameters:
port - a TCP port number.

export

public void export(org.omg.CORBA.portable.ObjectImpl impl,
                   org.objectweb.jonathan.apis.kernel.Context hints,
                   NamingContext nc)
            throws org.objectweb.jonathan.apis.kernel.JonathanException,
                   org.omg.CORBA.BAD_OPERATION
Exports a CORBA object implementation to the target adapter, and recursively to the provided naming context.

Parameters:
impl - a CORBA object implementation;
hints - additional information;
nc - a naming context to export the adapter identifier to.
Throws:
org.objectweb.jonathan.apis.kernel.JonathanException - if something goes wrong.
org.omg.CORBA.BAD_OPERATION - if the delegate of impl has not been set: this may mean that its base class has not been generated by the appropriate IDL compiler.

unexport

public void unexport(org.omg.CORBA.Object impl)
Unexports the provided CORBA object.

If the provided object has not been exported to the target adapter, this method silently returns.

Specified by:
unexport in interface SimpleAdapterOperations
Overrides:
unexport in class _SimpleAdapterImplBase