KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > ubermq > jms > server > Protocol


1 /*
2  * Copyright (c) 2004 Rhombus Technologies, Inc.
3  * All rights reserved.
4  */

5 package com.ubermq.jms.server;
6
7 import java.io.IOException JavaDoc;
8 import java.net.URI JavaDoc;
9
10 import com.ubermq.kernel.*;
11 import com.ubermq.kernel.IConnectionInfo.ConnectionAcceptor;
12
13
14 /**
15  * A pluggable protocol handler that can be attached to a message server
16  * instance. The server uses attached protocol objects to start acceptors
17  * and datagram processors.
18  *
19  * @since 2.1
20  */

21 public interface Protocol
22 {
23     /**
24      * Returns the service URI for this protocol. This may only
25      * be called after the start method has successfully completed.
26      *
27      * @return an URI describing how to connect to
28      * this protocol, or null if a URI cannot be used.
29      */

30     public URI JavaDoc getServiceURI();
31
32     /**
33      * Indicates if the protocol is enabled.
34      *
35      * @return true indicates enabled.
36      */

37     public boolean isEnabled();
38
39     /**
40      * Starts the protocol. This method should
41      * not return until the protocol is started.
42      *
43      * @param dp an IMessageProcessor
44      * @param a a connection acceptor
45      *
46      * @throws IOException if the protocol could not be started.
47      */

48     public void start(IMessageProcessor dp, IConnectionInfo.ConnectionAcceptor a)
49         throws IOException JavaDoc;
50
51     /**
52      * Stops the protocol. If the protocol has not been started,
53      * this call must not fail.
54      */

55     public void stop();
56 }
Popular Tags