Revert "Minor modernization of DynamicAny code"
[ACE_TAO.git] / TAO / tao / Adapter.h
blobe9f0556a7d5f51334372e9ed62bf3898deba3300
1 // -*- C++ -*-
3 //=============================================================================
4 /**
5 * @file Adapter.h
7 * @author Carlos O'Ryan (coryan@uci.edu)
8 */
9 //=============================================================================
11 #ifndef TAO_ADAPTER_H
12 #define TAO_ADAPTER_H
14 #include /**/ "ace/pre.h"
16 #include "tao/CORBA_methods.h"
18 #if !defined (ACE_LACKS_PRAGMA_ONCE)
19 # pragma once
20 #endif /* ACE_LACKS_PRAGMA_ONCE */
22 #include "tao/Pseudo_VarOut_T.h"
24 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
26 namespace CORBA
28 class Object;
29 typedef Object * Object_ptr;
31 typedef TAO_Pseudo_Var_T<Object> Object_var;
32 typedef TAO_Pseudo_Out_T<Object> Object_out;
35 namespace TAO
37 class ObjectKey;
40 class TAO_ORB_Core;
41 class TAO_Stub;
42 class TAO_MProfile;
43 class TAO_ServerRequest;
45 class TAO_Export TAO_Adapter
47 public:
48 virtual ~TAO_Adapter ();
50 /// Initialize the Adapter
51 virtual void open () = 0;
53 /// The ORB is shutting down, destroy any resources attached to this
54 /// adapter.
55 virtual void close (int wait_for_completion) = 0;
57 /// Check if the adapter can be closed in the current context, raise
58 /// an exception if not.
59 virtual void check_close (int wait_for_completion) = 0;
61 /**
62 * Return the priority assigned to this adapter.
63 * Adapters at higher priority are used first, the first adapter
64 * that matches a key is used to dispatch a request.
66 virtual int priority () const = 0;
68 /// Return the status....
69 virtual int dispatch (TAO::ObjectKey &key,
70 TAO_ServerRequest &request,
71 CORBA::Object_out forward_to) = 0;
73 enum {
74 /// The operation was successfully dispatched, an exception may
75 /// have been raised, but that is a correct execution too.
76 DS_OK,
78 /// There was a problem in dispatching the operation.
79 DS_FAILED,
81 /// The key is not in the right format for this Adapter, try the
82 /// next one.
83 DS_MISMATCHED_KEY,
85 /// Forward the request to another object reference, this decouples
86 /// the ORB from the PortableServer::ForwardRequest exception
87 DS_FORWARD,
89 /// The request will be forwarded, but using an async call to locate
90 /// the target. Some other entity will actually complete the forward
91 /// or fail.
92 DS_DEFERRED_FORWARD
95 /// Return the name, i.e. the object id used to resolve it in the
96 /// ORB.
97 virtual const char *name () const = 0;
99 /**
100 * Return the root of the Object Adapter.
101 * Each adapter defines its own IDL interface accessed through the
102 * method above.
104 virtual CORBA::Object_ptr root () = 0;
106 /// Create a collocated object using the given profile and stub.
107 virtual CORBA::Object_ptr create_collocated_object (TAO_Stub *,
108 const TAO_MProfile &) = 0;
110 /// Initialize a collocated object using the given stub
111 /// pointer for lazily evaluated object references.
112 virtual CORBA::Long initialize_collocated_object (TAO_Stub *) = 0;
115 TAO_END_VERSIONED_NAMESPACE_DECL
117 #include /**/ "ace/post.h"
119 #endif /* TAO_ADAPTER_H */