com.objectxp.msg
Class GsmConnector

java.lang.Object
  extended bycom.objectxp.msg.Connector
      extended bycom.objectxp.msg.GsmConnector

public abstract class GsmConnector
extends com.objectxp.msg.Connector

Base class for Gsm Connections.

See Also:
GsmSmsService

Method Summary
abstract  void connect()
          Connect to the Gsm Device
 void disconnect()
          Disconnects the connector.
 java.lang.String getName()
           
 int getNumberOfPendingOperations()
           
 com.objectxp.msg.Operation getOperation(java.io.InputStream in)
          Creates an operation object by evaluating the input stream.
 java.util.Enumeration getPendingOperations()
           
 long getTimeout()
           
 boolean getWaitForOKonCPIN()
           
 int getWindowSize()
           
 void handleIncomming(com.objectxp.msg.Operation operation)
          Handles all operations which are not results.
 void handleResult(com.objectxp.msg.Operation operation, com.objectxp.msg.Operation result)
          Handles all result operations.
 void handleTimeout(com.objectxp.msg.Operation operation, long timeout)
           
abstract  void init(java.util.Properties p)
          This method will be called by users of GsmConnector before communicating with the Gsm device.
 boolean isConnected()
           
 void operationWritten(com.objectxp.msg.Operation op)
           
 void setReceiveQueue(com.objectxp.util.BlockingQueue receiveQueue)
          Set the receive queue for incoming messages.
 void setTimeout(long timeout)
           
 void setWaitForOKonCPIN(boolean waitForOKonCPIN)
          Sets the waitForOKonCPIN.
 void setWindowSize(int size)
           
 com.objectxp.msg.Operation submitOperation(com.objectxp.msg.Operation op)
           
 com.objectxp.msg.Operation submitOperation(com.objectxp.msg.Operation op, boolean waitForResult, long timeout)
           
 void submitResult(com.objectxp.msg.Operation op)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

init

public abstract void init(java.util.Properties p)
                   throws java.lang.InstantiationException
This method will be called by users of GsmConnector before communicating with the Gsm device.

Parameters:
p - the configuration data needed by the Connector.
Throws:
java.lang.InstantiationException - if the connector could not initialize itself

connect

public abstract void connect()
                      throws java.io.IOException,
                             com.objectxp.util.TimedOutException
Connect to the Gsm Device

Throws:
java.io.IOException
com.objectxp.util.TimedOutException

setReceiveQueue

public void setReceiveQueue(com.objectxp.util.BlockingQueue receiveQueue)
Set the receive queue for incoming messages.

Parameters:
receiveQueue -

getOperation

public com.objectxp.msg.Operation getOperation(java.io.InputStream in)
Creates an operation object by evaluating the input stream.

Parameters:
in - input stream
Returns:
an operation object

handleResult

public void handleResult(com.objectxp.msg.Operation operation,
                         com.objectxp.msg.Operation result)
Description copied from class: com.objectxp.msg.Connector
Handles all result operations. Use for setting information on original operation (like message id) or broadcasting events (message sent or not sent)

Parameters:
operation - original operation
result - result operation

handleIncomming

public void handleIncomming(com.objectxp.msg.Operation operation)
Handles all operations which are not results.

Parameters:
operation - incomming operation

getWaitForOKonCPIN

public boolean getWaitForOKonCPIN()

setWaitForOKonCPIN

public void setWaitForOKonCPIN(boolean waitForOKonCPIN)
Sets the waitForOKonCPIN.

Parameters:
waitForOKonCPIN - The waitForOKonCPIN to set

submitOperation

public com.objectxp.msg.Operation submitOperation(com.objectxp.msg.Operation op,
                                                  boolean waitForResult,
                                                  long timeout)
                                           throws java.io.IOException,
                                                  com.objectxp.util.TimedOutException
Throws:
java.io.IOException
com.objectxp.util.TimedOutException

handleTimeout

public void handleTimeout(com.objectxp.msg.Operation operation,
                          long timeout)

operationWritten

public void operationWritten(com.objectxp.msg.Operation op)

getName

public java.lang.String getName()

disconnect

public void disconnect()
Description copied from class: com.objectxp.msg.Connector
Disconnects the connector. The reader thread is stopped. Internally @see #closeConnections() is called.


setWindowSize

public void setWindowSize(int size)

getWindowSize

public int getWindowSize()

submitOperation

public com.objectxp.msg.Operation submitOperation(com.objectxp.msg.Operation op)
                                           throws java.io.IOException,
                                                  com.objectxp.util.TimedOutException
Throws:
java.io.IOException
com.objectxp.util.TimedOutException

submitResult

public void submitResult(com.objectxp.msg.Operation op)
                  throws java.io.IOException
Throws:
java.io.IOException

isConnected

public boolean isConnected()

getTimeout

public long getTimeout()

setTimeout

public void setTimeout(long timeout)

getNumberOfPendingOperations

public int getNumberOfPendingOperations()

getPendingOperations

public java.util.Enumeration getPendingOperations()


object XP, Inc. © 2000-2007. All rights reserved object XP