org.huihoo.jfox.ms.crb.socket
Class SocketLinkServer

java.lang.Object
  extended byorg.huihoo.jfox.ms.crb.socket.SocketLinkServer
All Implemented Interfaces:
java.lang.Cloneable, LinkServer, java.io.Serializable

public class SocketLinkServer
extends java.lang.Object
implements LinkServer, java.io.Serializable, java.lang.Cloneable

Defines the methods that can be called by a client on the server.

Version:
@created July 23th 2003
Author:
Liang.Zhao (zlushangnwpu@sina.com)
See Also:
Serialized Form

Constructor Summary
SocketLinkServer(java.net.InetSocketAddress address)
           
 
Method Summary
 boolean authenticate(java.lang.String userName, java.lang.String password)
          Authenticate the user.
 javax.jms.Message[] browse(javax.jms.Destination destination, java.lang.String selector)
          Browse message on given destination
 void checkID(java.lang.String ID)
          Check if clientID is a valid ID
 java.lang.Object clone()
           
 LinkServer cloneLinkServer()
           
 void closeConnection()
          The client close the connection.
 void createConnection()
           
 javax.jms.Queue createQueue(java.lang.String destination)
          Create a queue identity
 javax.jms.TemporaryQueue createTemporaryQueue()
          Gets the TemporaryQueue
 javax.jms.TemporaryTopic createTemporaryTopic()
          Gets the TemporaryTopic
 javax.jms.Topic createTopic(java.lang.String destination)
          Create a topic identity
 void deleteTemporaryDestination(javax.jms.Destination destination)
          Delete a temporary destination from server
 java.lang.String getID()
          Get a clientID from the server.
static void main(java.lang.String[] args)
          only for test
 javax.jms.Message receiveMessage(javax.jms.Destination destination, long wait)
          Receive a message synchronously.
 void rleaseSource()
           
 void sendMessage(javax.jms.Message message)
          Send a message to the destination specifyed in the message.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SocketLinkServer

public SocketLinkServer(java.net.InetSocketAddress address)
Method Detail

createConnection

public void createConnection()
                      throws java.lang.Exception
Throws:
java.lang.Exception

rleaseSource

public void rleaseSource()

cloneLinkServer

public LinkServer cloneLinkServer()
                           throws java.lang.Exception
Specified by:
cloneLinkServer in interface LinkServer
Returns:
LinkServer
Throws:
java.lang.Exception

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Returns:
Object
Throws:
java.lang.CloneNotSupportedException

getID

public java.lang.String getID()
                       throws java.lang.Exception
Get a clientID from the server.

Specified by:
getID in interface LinkServer
Returns:
an internally generated clientID.
Throws:
java.lang.Exception

createTemporaryTopic

public javax.jms.TemporaryTopic createTemporaryTopic()
                                              throws java.lang.Exception
Gets the TemporaryTopic

Specified by:
createTemporaryTopic in interface LinkServer
Returns:
TemporaryTopic
Throws:
java.lang.Exception

createTemporaryQueue

public javax.jms.TemporaryQueue createTemporaryQueue()
                                              throws java.lang.Exception
Gets the TemporaryQueue

Specified by:
createTemporaryQueue in interface LinkServer
Returns:
TemporaryQueue
Throws:
java.lang.Exception

closeConnection

public void closeConnection()
                     throws java.lang.Exception
The client close the connection.

Specified by:
closeConnection in interface LinkServer
Throws:
java.lang.Exception

checkID

public void checkID(java.lang.String ID)
             throws java.lang.Exception
Check if clientID is a valid ID

Specified by:
checkID in interface LinkServer
Throws:
java.lang.Exception

sendMessage

public void sendMessage(javax.jms.Message message)
                 throws java.lang.Exception
Send a message to the destination specifyed in the message.

Specified by:
sendMessage in interface LinkServer
Throws:
java.lang.Exception

createQueue

public javax.jms.Queue createQueue(java.lang.String destination)
                            throws java.lang.Exception
Create a queue identity

Specified by:
createQueue in interface LinkServer
Returns:
Queue
Throws:
java.lang.Exception

createTopic

public javax.jms.Topic createTopic(java.lang.String destination)
                            throws java.lang.Exception
Create a topic identity

Specified by:
createTopic in interface LinkServer
Parameters:
destination -
Returns:
Topic
Throws:
java.lang.Exception

deleteTemporaryDestination

public void deleteTemporaryDestination(javax.jms.Destination destination)
                                throws java.lang.Exception
Delete a temporary destination from server

Specified by:
deleteTemporaryDestination in interface LinkServer
Throws:
java.lang.Exception

browse

public javax.jms.Message[] browse(javax.jms.Destination destination,
                                  java.lang.String selector)
                           throws java.lang.Exception
Browse message on given destination

Specified by:
browse in interface LinkServer
Returns:
Message[]
Throws:
java.lang.Exception

receiveMessage

public javax.jms.Message receiveMessage(javax.jms.Destination destination,
                                        long wait)
                                 throws java.lang.Exception
Receive a message synchronously.

Specified by:
receiveMessage in interface LinkServer
Returns:
Message
Throws:
java.lang.Exception

authenticate

public boolean authenticate(java.lang.String userName,
                            java.lang.String password)
                     throws java.lang.Exception
Authenticate the user.

Specified by:
authenticate in interface LinkServer
Returns:
boolean
Throws:
java.lang.Exception

main

public static void main(java.lang.String[] args)
only for test



Copyright © 2002-2003 Open Enterprise Foundation. All Rights Reserved.