public int registerUniqueApplication ( String strQueueName , String strQueueType ) { // HACK - This works if you are careful about starting the server... DONT TRUST THIS CODE! // todo(don) - THIS DOES NOT WORK CORRECTLY (need to register this app with jini or write an entry in a table or use the lock server or something) Map < String , Object > properties = new HashMap < String , Object > ( ) ; properties . put ( "removeListener" , Boolean . TRUE ) ; BaseMessage message = new MapMessage ( new BaseMessageHeader ( strQueueName , strQueueType , this , properties ) , properties ) ; this . getMessageManager ( ) . sendMessage ( message ) ; // Make sure there is no listener that will start this server up. return Constants . NORMAL_RETURN ; }
Register this unique application so there will be only one running .