/** * Free all the resources belonging to this applet. If all applet screens are closed, shut down the applet. */ public void free() { super.free(); } /**
/** * Initializes the BaseApplication. * Usually you pass the object that wants to use this sesssion. * For example, the applet or BaseApplication. */ public void init(BaseMessageQueue messageQueue) { super.init(messageQueue); } /**
/** * Send this message to the message queue. * @param strCommand Command to perform remotely. * @return boolean success. */ public void sendMessage(Message message) throws RemoteException { Utility.getLogger().info("EJB sendMessage: " + message); if (((BaseMessage)message).isProcessedByClient()) ((BaseMessage)message).setProcessedByClientSession(this.getParentSession()); m_messageSender.sendMessage(message); } }
/** * Run this task thats only job is to pull messages from the server and place them on the local queue. */ public void run() { while (m_receiveQueueThread != null) { Message message = this.receiveMessage(); // Hang until a message comes through if ((m_receiveQueueThread == null) || (message == null)) return; // End of processing, stop this thread. getMessageQueue().getMessageSender().sendMessage(message); // Add to the queue to process } } /**
/** * Free the receiver (and the remote session). */ public void free() { if (m_sendQueue != null) { try { m_sendQueue.freeRemoteSession(); } catch (RemoteException ex) { ex.printStackTrace(); } } m_sendQueue = null; super.free(); } /**
/** * Creates new MessageSender. * @param server The remote server. * @param baseMessageQueue My parent message queue. */ public void init(RemoteTask server, BaseMessageQueue baseMessageQueue) throws RemoteException { super.init(baseMessageQueue); m_sendQueue = server.createRemoteSendQueue(baseMessageQueue.getQueueName(), baseMessageQueue.getQueueType()); } /**