public void doProcess(InputStream in, PrintWriter out, Map<String, Object> properties)
        throws RemoteException
    {
        String strCommand = this.getProperty(REMOTE_COMMAND, properties);
        if (MAKE_REMOTE_TABLE.equals(strCommand))
        {
            String strRecordClassName = this.getNextStringParam(in, NAME, properties);
            String strTableSessionClassName = this.getNextStringParam(in, SESSION_CLASS_NAME, properties);
            Map<String,Object> propIn = this.getNextPropertiesParam(in, PROPERTIES, properties);
            Map<String,Object> propDatabase = this.getNextPropertiesParam(in, PROPERTIES_DB, properties);
            if (propIn != null)
                properties.putAll(propIn);
            RemoteTable remoteTable = ((RemoteTask)m_remoteObject).makeRemoteTable(strRecordClassName, strTableSessionClassName, properties, propDatabase);
            String strTableID = this.add(new TableHolder(this, remoteTable));
            this.setReturnString(out, strTableID);
        }
        else if (CREATE_REMOTE_TASK.equals(strCommand))
        {   // Note: I am not the parent, the proxyTask (the application task) is.
            Map<String,Object> propIn = this.getNextPropertiesParam(in, PROPERTIES, properties);
            if (propIn != null)
                properties.putAll(propIn);
            Application app = ((TaskSession)this.getRemoteObject()).getApplication();
            RemoteTask remoteTask = m_proxyTask.getNewRemoteTask(app, properties);  // Parent is MY APPLICATION not ME.
            String strUniqueID = m_proxyTask.add(new TaskHolder(m_proxyTask, remoteTask));  // Parent is Parent Proxy not ME.
            out.write(strUniqueID);
        }
        else if (CREATE_REMOTE_RECEIVE_QUEUE.equals(strCommand))
        {
            String strQueueName = this.getNextStringParam(in, MessageConstants.QUEUE_NAME, properties);
            String strQueueType = this.getNextStringParam(in, MessageConstants.QUEUE_TYPE, properties);
            RemoteReceiveQueue remoteReceiveQueue = ((RemoteTask)m_remoteObject).createRemoteReceiveQueue(strQueueName, strQueueType);
            String strID = this.find(remoteReceiveQueue);
            if (strID == null)
                strID = this.add(new ReceiveQueueHolder(this, remoteReceiveQueue));
            this.setReturnString(out, strID);
        }
        else if (CREATE_REMOTE_SEND_QUEUE.equals(strCommand))
        {
            String strQueueName = this.getNextStringParam(in, MessageConstants.QUEUE_NAME, properties);
            String strQueueType = this.getNextStringParam(in, MessageConstants.QUEUE_TYPE, properties);
            RemoteSendQueue remoteSendQueue = ((RemoteTask)m_remoteObject).createRemoteSendQueue(strQueueName, strQueueType);
            String strID = this.find(remoteSendQueue);
            if (strID == null)
                strID = this.add(new SendQueueHolder(this, remoteSendQueue));
            this.setReturnString(out, strID);
        }
        else if (SET_REMOTE_MESSAGE_TASK.equals(strCommand))
        {
            String strTaskID = this.getNextStringParam(in, ID, properties);
            BaseHolder sessionHolder = this.getSessionFromPath(strTaskID);
            if (sessionHolder instanceof TaskHolder)
            {       // Always
                RemoteTask remoteTask = (RemoteTask)sessionHolder.getRemoteObject();
                ((RemoteTask)m_remoteObject).setRemoteMessageTask(remoteTask);
            }
            else
                Utility.getLogger().warning("Remote session not found");
        }
        else if (LOGIN.equals(strCommand))
        {
            String strUserName = this.getNextStringParam(in, Params.USER_NAME, properties);
            String strPassword = this.getNextStringParam(in, Params.PASSWORD, properties);
            String strDomain = this.getNextStringParam(in, Params.DOMAIN, properties);
            Map<String,Object> mapLoginInfo = ((RemoteTask)m_remoteObject).login(strUserName, strPassword, strDomain);
            // First, see if this is in my list already?
            this.setReturnObject(out, mapLoginInfo);
        }
        else
            super.doProcess(in, out, properties);
    }
public void doProcess ( InputStream in , PrintWriter out , Map < String , Object > properties ) throws RemoteException { String strCommand = this . getProperty ( REMOTE_COMMAND , properties ) ; if ( MAKE_REMOTE_TABLE . equals ( strCommand ) ) { String strRecordClassName = this . getNextStringParam ( in , NAME , properties ) ; String strTableSessionClassName = this . getNextStringParam ( in , SESSION_CLASS_NAME , properties ) ; Map < String , Object > propIn = this . getNextPropertiesParam ( in , PROPERTIES , properties ) ; Map < String , Object > propDatabase = this . getNextPropertiesParam ( in , PROPERTIES_DB , properties ) ; if ( propIn != null ) properties . putAll ( propIn ) ; RemoteTable remoteTable = ( ( RemoteTask ) m_remoteObject ) . makeRemoteTable ( strRecordClassName , strTableSessionClassName , properties , propDatabase ) ; String strTableID = this . add ( new TableHolder ( this , remoteTable ) ) ; this . setReturnString ( out , strTableID ) ; } else if ( CREATE_REMOTE_TASK . equals ( strCommand ) ) { Map < String , Object > propIn = this . getNextPropertiesParam ( in , PROPERTIES , properties ) ; if ( propIn != null ) properties . putAll ( propIn ) ; Application app = ( ( TaskSession ) this . getRemoteObject ( ) ) . getApplication ( ) ; RemoteTask remoteTask = m_proxyTask . getNewRemoteTask ( app , properties ) ; String strUniqueID = m_proxyTask . add ( new TaskHolder ( m_proxyTask , remoteTask ) ) ; out . write ( strUniqueID ) ; } else if ( CREATE_REMOTE_RECEIVE_QUEUE . equals ( strCommand ) ) { String strQueueName = this . getNextStringParam ( in , MessageConstants . QUEUE_NAME , properties ) ; String strQueueType = this . getNextStringParam ( in , MessageConstants . QUEUE_TYPE , properties ) ; RemoteReceiveQueue remoteReceiveQueue = ( ( RemoteTask ) m_remoteObject ) . createRemoteReceiveQueue ( strQueueName , strQueueType ) ; String strID = this . find ( remoteReceiveQueue ) ; if ( strID == null ) strID = this . add ( new ReceiveQueueHolder ( this , remoteReceiveQueue ) ) ; this . setReturnString ( out , strID ) ; } else if ( CREATE_REMOTE_SEND_QUEUE . equals ( strCommand ) ) { String strQueueName = this . getNextStringParam ( in , MessageConstants . QUEUE_NAME , properties ) ; String strQueueType = this . getNextStringParam ( in , MessageConstants . QUEUE_TYPE , properties ) ; RemoteSendQueue remoteSendQueue = ( ( RemoteTask ) m_remoteObject ) . createRemoteSendQueue ( strQueueName , strQueueType ) ; String strID = this . find ( remoteSendQueue ) ; if ( strID == null ) strID = this . add ( new SendQueueHolder ( this , remoteSendQueue ) ) ; this . setReturnString ( out , strID ) ; } else if ( SET_REMOTE_MESSAGE_TASK . equals ( strCommand ) ) { String strTaskID = this . getNextStringParam ( in , ID , properties ) ; BaseHolder sessionHolder = this . getSessionFromPath ( strTaskID ) ; if ( sessionHolder instanceof TaskHolder ) { RemoteTask remoteTask = ( RemoteTask ) sessionHolder . getRemoteObject ( ) ; ( ( RemoteTask ) m_remoteObject ) . setRemoteMessageTask ( remoteTask ) ; } else Utility . getLogger ( ) . warning ( "Remote session not found" ) ; } else if ( LOGIN . equals ( strCommand ) ) { String strUserName = this . getNextStringParam ( in , Params . USER_NAME , properties ) ; String strPassword = this . getNextStringParam ( in , Params . PASSWORD , properties ) ; String strDomain = this . getNextStringParam ( in , Params . DOMAIN , properties ) ; Map < String , Object > mapLoginInfo = ( ( RemoteTask ) m_remoteObject ) . login ( strUserName , strPassword , strDomain ) ; this . setReturnObject ( out , mapLoginInfo ) ; } else super . doProcess ( in , out , properties ) ; }
Handle the command send from my client peer.
@param in The (optional) Inputstream to get the params from.
@param out The stream to write the results.