JACK 5.4 Application Interface

aos.dci
Interface CommsObject


public interface CommsObject

This interface provides a way to interpose a user supplied derived type into the lowest communications level where supported by the particular portal type.

Here is an example for a "UDP" portal.

 import java.net.*;

 class MyUDPInit implements aos.dci.CommsObject
 {
     // This would probably be defined as a top level class
     // in actual use.
     static class MyDatagramSocket extends DatagramSocket
     {
         public MyDatagramSocket(int port) throws SocketException
         {
             super(port);
             System.err.println("Create a MyDatagramSocket on port="+port);
         }
         // Add any other methods you wish to override.
     }

     // If an object of this type is registered with the DCI, then
     // this method will be automatically called when a portal is created.
     public Object createCommsObject(Object obj) throws Exception
     {
         int port = ((Integer)obj).intValue();
         return new MyDatagramSocket(port);
     }
 }
 

To register the initialization object with the DCI, you need to call the following method. For example you could do this in a static block in the main class:

 static {
     aos.jack.jak.core.Dci.initCommsObject("UDP", new MyUDPInit());
 }
 


Method Summary
 java.lang.Object createCommsObject(java.lang.Object o)
          Return a low level communications object/channel.
 

Method Detail

createCommsObject

public java.lang.Object createCommsObject(java.lang.Object o)
Return a low level communications object/channel. The actual argument type and return type depend on the portal type.


JACK 5.4 Application Interface

Copyright (C) 1999-2008, Agent Oriented Software Pty. Ltd.

US Government Restricted Rights
The JACK Modules and relevant Software Material have been developed entirely at private expense and are accordingly provided with RESTRICTED RIGHTS. Use, duplication, or disclosure by Government is subject to restrictions as set forth in subparagraph (c)(1)(ii) of DFARS 252.227-7013 or subparagraph (c)(1) and (2) of the Commercial Computer Software Restricted Rights and 48 CFR 52.2270-19, as applicable.


Agent Oriented Software Pty. Ltd.     http://www.aosgrp.com
PO Box 639, Carlton South, Victoria 3053, Australia
Phone: +61 3 9349 5055, Fax: +61 3 9349 5088