home *** CD-ROM | disk | FTP | other *** search
/ Java 1.2 How-To / JavaHowTo.iso / 3rdParty / jbuilder / TRIAL / JBUILDER / JVISBRKR.Z / TimerServerInterceptor.java < prev    next >
Encoding:
Java Source  |  1998-05-08  |  3.0 KB  |  87 lines

  1. /*
  2.  * Copyright (c) 1997-1998 Borland International, Inc. All Rights Reserved.
  3.  * 
  4.  * This SOURCE CODE FILE, which has been provided by Borland as part
  5.  * of a Borland product for use ONLY by licensed users of the product,
  6.  * includes CONFIDENTIAL and PROPRIETARY information of Borland.  
  7.  *
  8.  * USE OF THIS SOFTWARE IS GOVERNED BY THE TERMS AND CONDITIONS 
  9.  * OF THE LICENSE STATEMENT AND LIMITED WARRANTY FURNISHED WITH
  10.  * THE PRODUCT.
  11.  *
  12.  * IN PARTICULAR, YOU WILL INDEMNIFY AND HOLD BORLAND, ITS RELATED
  13.  * COMPANIES AND ITS SUPPLIERS, HARMLESS FROM AND AGAINST ANY CLAIMS
  14.  * OR LIABILITIES ARISING OUT OF THE USE, REPRODUCTION, OR DISTRIBUTION
  15.  * OF YOUR PROGRAMS, INCLUDING ANY CLAIMS OR LIABILITIES ARISING OUT OF
  16.  * OR RESULTING FROM THE USE, MODIFICATION, OR DISTRIBUTION OF PROGRAMS
  17.  * OR FILES CREATED FROM, BASED ON, AND/OR DERIVED FROM THIS SOURCE
  18.  * CODE FILE.
  19.  */
  20. package visibroker.samples.interceptor.timer;
  21.  
  22. import com.visigenic.vbroker.interceptor.*;
  23. import com.visigenic.vbroker.IOP.*;
  24. import com.visigenic.vbroker.GIOP.*;
  25. import org.omg.CORBA.portable.*;
  26.  
  27. public class TimerServerInterceptor extends TimerInterceptor implements ServerInterceptor
  28. {
  29.     public IOR locate(int req_id, byte[] object_key, Closure closure)
  30.     {
  31.         closure.object = new TimerData();
  32.         return null;
  33.     }
  34.  
  35.     public void locate_succeeded(int req_id, Closure closure)
  36.     {
  37.         print("locate", null, closure.object);
  38.     }
  39.  
  40.     public void locate_forwarded(int req_id, IORHolder forward_ior, Closure closure)
  41.     {
  42.         print("locate", null, closure.object);
  43.     }
  44.  
  45.     public IOR locate_failed(int req_id, byte[] object_key, Closure closure)
  46.     {
  47.         print("locate", null, closure.object);
  48.         return null;
  49.     }
  50.  
  51.     public InputStream receive_request(RequestHeader hdr, org.omg.CORBA.ObjectHolder target, InputStream buf, Closure closure)
  52.     {
  53.         begin(closure, hdr.operation);
  54.         return null;
  55.     }
  56.  
  57.     public void prepare_reply(RequestHeader hdr, ReplyHeaderHolder reply, org.omg.CORBA.Object target, Closure closure)
  58.     {
  59.         delta(closure, "process time");
  60.     }
  61.  
  62.     public org.omg.CORBA.portable.OutputStream send_reply(RequestHeader reqHdr, ReplyHeader hdr, org.omg.CORBA.Object target, OutputStream buf, org.omg.CORBA.Environment env, Closure closure)
  63.     {
  64.         delta(closure, "prepare response");
  65.         return null;
  66.     }
  67.  
  68.     public void send_reply_failed(RequestHeader reqHdr, ReplyHeader replyHdr, org.omg.CORBA.Object target, org.omg.CORBA.Environment env, Closure closure)
  69.     {
  70.         delta(closure, "send time");
  71.     }
  72.  
  73.     public void request_completed(RequestHeader reqHdr, org.omg.CORBA.Object target, Closure closure)
  74.     {
  75.         delta(closure, "send time");
  76.         complete(closure, "total call");
  77.     }
  78.  
  79.     public void shutdown(com.visigenic.vbroker.interceptor.ServerInterceptorPackage.ShutdownReason reason)
  80.     {
  81.     }
  82.  
  83.     public void exception_occurred(RequestHeader reqHdr, org.omg.CORBA.Environment env, Closure closure)
  84.     {
  85.     }
  86. }
  87.