/[classpath]/classpath/gnu/CORBA/Poa/gnuServantObject.java
ViewVC logotype

Diff of /classpath/gnu/CORBA/Poa/gnuServantObject.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1.2.2 by gnu_andrew, Sat Sep 10 15:31:36 2005 UTC revision 1.1.2.3 by gnu_andrew, Wed Nov 2 00:43:26 2005 UTC
# Line 39  exception statement from your version. * Line 39  exception statement from your version. *
39  package gnu.CORBA.Poa;  package gnu.CORBA.Poa;
40    
41  import gnu.CORBA.GIOP.ReplyHeader;  import gnu.CORBA.GIOP.ReplyHeader;
42  import gnu.CORBA.IOR_Delegate;  import gnu.CORBA.IorDelegate;
43  import gnu.CORBA.IOR_contructed_object;  import gnu.CORBA.IorObject;
44  import gnu.CORBA.Interceptor.gnuServerRequestInfo;  import gnu.CORBA.Interceptor.gnuServerRequestInfo;
45    import gnu.CORBA.typecodes.RecordTypeCode;
46    import gnu.CORBA.IOR;
47    import gnu.CORBA.IorProvider;
48    import gnu.CORBA.Minor;
49  import gnu.CORBA.ObjectCreator;  import gnu.CORBA.ObjectCreator;
50  import gnu.CORBA.Unexpected;  import gnu.CORBA.Unexpected;
51  import gnu.CORBA.bufferedResponseHandler;  import gnu.CORBA.ResponseHandlerImpl;
52  import gnu.CORBA.recordTypeCode;  import gnu.CORBA.StreamHolder;
 import gnu.CORBA.streamReadyHolder;  
53    
54  import org.omg.CORBA.Any;  import org.omg.CORBA.Any;
55  import org.omg.CORBA.BAD_OPERATION;  import org.omg.CORBA.BAD_OPERATION;
# Line 90  import java.util.Arrays; Line 93  import java.util.Arrays;
93  public class gnuServantObject extends ObjectImpl  public class gnuServantObject extends ObjectImpl
94    implements org.omg.CORBA.Object,    implements org.omg.CORBA.Object,
95      InvokeHandler,      InvokeHandler,
96      CurrentOperations      CurrentOperations,
97        IorProvider
98  {  {
99    /**    /**
100     * The associated servant that must also implement the {@link InvokeHandler}     * The associated servant that must also implement the {@link InvokeHandler}
# Line 144  public class gnuServantObject extends Ob Line 148  public class gnuServantObject extends Ob
148      poa = a_poa;      poa = a_poa;
149      orb = an_orb;      orb = an_orb;
150    }    }
151      
152      /**
153       * Get the IOR as it would be for this object.
154       */
155      public IOR getIor()
156      {
157        return orb.getLocalIor(this);    
158      }
159    
160    /**    /**
161     * Create a servant object, associated with the passed servant.     * Create a servant object, associated with the passed servant.
# Line 257  public class gnuServantObject extends Ob Line 269  public class gnuServantObject extends Ob
269                }                }
270              catch (Exception ex)              catch (Exception ex)
271                {                {
                 ex.printStackTrace();  
   
272                  BAD_OPERATION bad =                  BAD_OPERATION bad =
273                    new BAD_OPERATION("Unable to activate", 0x5004,                    new BAD_OPERATION("Unable to activate", Minor.Activation,
274                      CompletionStatus.COMPLETED_NO                      CompletionStatus.COMPLETED_NO
275                    );                    );
276                  bad.initCause(ex);                  bad.initCause(ex);
# Line 276  public class gnuServantObject extends Ob Line 286  public class gnuServantObject extends Ob
286          // No servant and no servant manager - throw exception.          // No servant and no servant manager - throw exception.
287          else          else
288            {            {
289              throw new BAD_OPERATION("Unable to activate", 0x5002,              throw new BAD_OPERATION("Unable to activate", Minor.Activation,
290                CompletionStatus.COMPLETED_NO                CompletionStatus.COMPLETED_NO
291              );              );
292            }            }
# Line 294  public class gnuServantObject extends Ob Line 304  public class gnuServantObject extends Ob
304        }        }
305      else if (a_servant instanceof DynamicImplementation)      else if (a_servant instanceof DynamicImplementation)
306        {        {
307          return new dynImpHandler((DynamicImplementation) a_servant);          return new DynamicImpHandler((DynamicImplementation) a_servant);
308        }        }
309      else      else
310        {        {
# Line 402  public class gnuServantObject extends Ob Line 412  public class gnuServantObject extends Ob
412      boolean intercept = false;      boolean intercept = false;
413      ServerRequestInterceptorOperations interceptor = null;      ServerRequestInterceptorOperations interceptor = null;
414      gnuServerRequestInfo info = null;      gnuServerRequestInfo info = null;
415      bufferedResponseHandler i_handler = null;      ResponseHandlerImpl i_handler = null;
416    
417      try      try
418        {        {
419          if (orb.iServer != null &&          if (orb.iServer != null &&
420            r_handler instanceof bufferedResponseHandler            r_handler instanceof ResponseHandlerImpl
421          )          )
422            {            {
423              interceptor = orb.iServer;              interceptor = orb.iServer;
424    
425              i_handler = (bufferedResponseHandler) r_handler;              i_handler = (ResponseHandlerImpl) r_handler;
426    
427              info =              info =
428                new gnuServerRequestInfo(this, i_handler.request_header,                new gnuServerRequestInfo(this, i_handler.request_header,
# Line 426  public class gnuServantObject extends Ob Line 436  public class gnuServantObject extends Ob
436          try          try
437            {            {
438              CookieHolder cookie = null;              CookieHolder cookie = null;
439              activeObjectMap.Obj self = poa.aom.get(Id);              AOM.Obj self = poa.aom.get(Id);
440    
441              if (poa.servant_locator != null)              if (poa.servant_locator != null)
442                {                {
# Line 467  public class gnuServantObject extends Ob Line 477  public class gnuServantObject extends Ob
477                {                {
478                  // In some cases exception is thrown if the delegate is not set.                  // In some cases exception is thrown if the delegate is not set.
479                }                }
480              if (d instanceof servantDelegate)              if (d instanceof ServantDelegateImpl)
481                {                {
482                  // If the delegate is already set, check maybe we can                  // If the delegate is already set, check maybe we can
483                  // reuse the existing instance.                  // reuse the existing instance.
484                  if (((servantDelegate) d).object != this)                  if (((ServantDelegateImpl) d).object != this)
485                    {                    {
486                      servant._set_delegate(new servantDelegate(servant, poa, Id));                      servant._set_delegate(new ServantDelegateImpl(servant, poa, Id));
487                    }                    }
488                }                }
489              else              else
490                {                {
491                  servant._set_delegate(new servantDelegate(servant, poa, Id));                  servant._set_delegate(new ServantDelegateImpl(servant, poa, Id));
492                }                }
493    
494              try              try
# Line 536  public class gnuServantObject extends Ob Line 546  public class gnuServantObject extends Ob
546                                      {                                      {
547                                        // Failed due any reason, insert without                                        // Failed due any reason, insert without
548                                        // helper.                                        // helper.
549                                        a.insert_Streamable(new streamReadyHolder(                                        a.insert_Streamable(new StreamHolder(
550                                            buf.create_input_stream()                                            buf.create_input_stream()
551                                          )                                          )
552                                        );                                        );
553    
554                                        recordTypeCode r =                                        RecordTypeCode r =
555                                          new recordTypeCode(TCKind.tk_except);                                          new RecordTypeCode(TCKind.tk_except);
556                                        r.setId(uex_idl);                                        r.setId(uex_idl);
557                                        r.setName(ObjectCreator.getDefaultName(                                        r.setName(ObjectCreator.getDefaultName(
558                                            uex_idl                                            uex_idl
# Line 774  public class gnuServantObject extends Ob Line 784  public class gnuServantObject extends Ob
784          gnuServantObject g = (gnuServantObject) other;          gnuServantObject g = (gnuServantObject) other;
785          return orb == g.orb && poa == g.poa && Arrays.equals(Id, g.Id);          return orb == g.orb && poa == g.poa && Arrays.equals(Id, g.Id);
786        }        }
787      else if (other instanceof IOR_contructed_object)      else if (other instanceof IorObject)
788        {        {
789          IOR_contructed_object ir = ((IOR_contructed_object) other);          IorObject ir = ((IorObject) other);
790          try          try
791            {            {
792              IOR_Delegate ird = (IOR_Delegate) ir._get_delegate();              IorDelegate ird = (IorDelegate) ir._get_delegate();
793              byte[] ior_id = poa.idFormIor(ird.getIor().key);              byte[] ior_id = poa.idFormIor(ird.getIor().key);
794              if (ior_id != null && Arrays.equals(ior_id, Id))              if (ior_id != null && Arrays.equals(ior_id, Id))
795                {                {

Legend:
Removed from v.1.1.2.2  
changed lines
  Added in v.1.1.2.3

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26