1 22 package org.jboss.mq.il.rmi; 23 24 import javax.jms.IllegalStateException ; 25 import javax.jms.JMSException ; 26 27 import org.jboss.mq.Connection; 28 import org.jboss.mq.ReceiveRequest; 29 import org.jboss.mq.SpyDestination; 30 31 39 public class RMIClientIL extends java.rmi.server.UnicastRemoteObject implements RMIClientILRemote 40 { 41 42 43 private static final long serialVersionUID = -2587261916187410219L; 44 45 Connection connection; 47 boolean stopped = true; 49 50 public RMIClientIL(Connection c) 51 throws java.rmi.RemoteException 52 { 53 connection = c; 54 } 55 56 61 public void close() 62 throws Exception 63 { 64 if (stopped) 65 { 66 throw new IllegalStateException ("The client IL is stopped"); 67 } 68 connection.asynchClose(); 69 } 70 71 78 public void deleteTemporaryDestination(SpyDestination dest) 79 throws JMSException 80 { 81 if (stopped) 82 { 83 throw new IllegalStateException ("The client IL is stopped"); 84 } 85 connection.asynchDeleteTemporaryDestination(dest); 86 } 87 88 94 public void receive(ReceiveRequest messages[]) 95 throws Exception 96 { 97 if (stopped) 98 { 99 throw new IllegalStateException ("The client IL is stopped"); 100 } 101 connection.asynchDeliver(messages); 102 } 103 104 110 public void pong(long serverTime) 111 throws JMSException 112 { 113 if (stopped) 114 { 115 throw new IllegalStateException ("The client IL is stopped"); 116 } 117 connection.asynchPong(serverTime); 118 } 119 } 120 | Popular Tags |