You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fx-dev@ws.apache.org by sn...@opensource.lk on 2004/05/06 17:36:32 UTC

Sandesha code format

Hi Dims,


We have finalized all development work relating to classes with basic
functionality for WSRM. So, our next commit will make lot of changes to
the existing classes . To keep your formatting in existing classes, we
were going through the formatting you did and formatted the new classes
accordingly.
We have concerned on the following aspects of formatting.
1.	Licenses
2.	Author
3.	Fields Comments
4.	Method Comments

Please glance through sample class as shown below and send let us know
whether it is ok to commit as mentioned.

Regards
Sandesha Team


 ---------------------------------------------------------------------------
/*
 * Copyright  1999-2004 The Apache Software Foundation.
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 *
 */

package org.apache.sandesha.client;

import org.apache.axis.message.addressing.MessageID;

import org.apache.sandesha.RMMessage;
import org.apache.sandesha.RMSequence;
import org.apache.sandesha.ws.utility.Identifier;

import java.util.HashMap;
import java.util.Map;


/**
 * @author
 * Amila Navarathna<br>
 * Jaliya Ekanayaka<br>
 * Sudar Nimalan<br>
 * (Apache Sandesha Project)
 *
 */
public class ClientMessageController {
	/**
	 * Field instance
	 */
    private static ClientMessageController instance;
	/**
	 * Field messageMap
	 */
    private Map messageMap;
	/**
	 * Field sequenceMap
	 */
    private Map sequenceMap;
	/**
	 * Field seqAck
	 */

    private Identifier sequenceIdentifier;

	/**
	 * Constructor ClientMessageController
	 */
    private ClientMessageController() {
        sequenceMap = new HashMap();
        messageMap = new HashMap();
    }

	/**
	 * Method getInstance
	 *
	 * @return ClientMessageController
	 */
     public static ClientMessageController getInstance() {

        if (instance == null) {
            instance = new ClientMessageController();
        }

        return instance;
    }

	/**
	 * Method retrieveIfMessageExists
	 *
	 * returns a RMMessage if a message for the message id exists.
	 * else return a null value
	 * <b>developer must handle the null value returned</b>
	 *
	 * @param messageID
	 * @return RMMessage
	 *
	 *
	 */

    public RMMessage retrieveIfMessageExists(MessageID messageID) {
    	RMMessage rmMessage = (RMMessage)messageMap.get(messageID.toString());
        if (rmMessage!= null) {
            return rmMessage;
        } else {
            return null;
        }
    }


    /**
     * Method storeSequence
     *
     * stores a sequence object in the map. Each of these sequence objects
     * consists of one or more message objects.
     * The sequences are stored as the sequenceIdentifier as a key
     *
     * @param sequence
     *
     *
     */
    public void storeSequence(RMSequence sequence) {
        //System.out.println("----------------storeSequence::"+sequence.getSequenceIdetifer());
        sequenceMap.put(sequence.getSequenceIdetifer().toString(), sequence);
    }

	/**
	 * Method storeMessage
	 *
	 * stores a message object in the map.
	 * The message are stored as the message id as a key
	 *
	 * @param message
	 *
	 *
	 */

    public void storeMessage(RMMessage message) {
        messageMap.put(message.getMessageID().toString(), message);
    }


    /**
     * Method retrieveIfSequenceExists
     *
     * returns a RMSequence if a sequence for the identifier exists.
     * else return a null value
     * <b>developer must handle the null value returned</b>
     * @param identifier
     *
     * @return RMSequence
     *
     *
     */
    public RMSequence retrieveIfSequenceExists(Identifier identifier) {
    	RMSequence rmSequence =
(RMSequence)sequenceMap.get(identifier.getIdentifier().toString());
        if (rmSequence != null) {
            return rmSequence;
        } else {
            return null;
        }
    }



	/**
	 * Method removeIfSequenceExists
	 *
	 * Search for a sequence and if it exists(means it is in the map),
	 * remove it from the map
	 *
	 * @param identifier
	 *
	 *
	 */
	public void removeIfSequenceExists(Identifier identifier) {
		if (sequenceMap.get(identifier.toString()) != null) {
			sequenceMap.remove(identifier.toString());
		}
	}
	/**
	 * Method getSequenceIdentifier
	 *
	 * @return Identifier
	 */
	public Identifier getSequenceIdentifier() {
		return sequenceIdentifier;
	}

	/**
	 * Method setSequenceIdentifier
	 *
	 * @param  identifier
	 *
	 */
	public void setSequenceIdentifier(Identifier identifier) {
		sequenceIdentifier = identifier;
	}

}

----------------------------------------







Re: Sandesha Exception Handling

Posted by Aleksander Slominski <as...@cs.indiana.edu>.
command 'cvs diff' will work too - here is good documentation about it
http://cvsbook.red-bean.com/cvsbook.html#Finding_Out_What_You__And_Others__Did_--_update_And_diff 


alek

Davanum Srinivas wrote:

>Nimalan,
>
>Please do a compare with existing code in cvs (use a tool like windiff
>or equivalent). I don't remember from the top of my head.
>
>thanks,
>dims
>
>On Thu, 6 May 2004 13:29:39 -0400 (EDT), snimalan@opensource.lk
><sn...@opensource.lk> wrote:
>  
>
>>Hi Dims,
>>Now we are having catch blocks only in follwing classes.
>>1. RMSequence
>>2. RMClientService
>>3. MessageInserter
>>4. RMClientRequestHandler
>>5. RMClientResponseHandler
>>6. RMServerRequestHandler
>>
>>When we are handling the exception for 1,2 and 3 we are using log.error(e)
>>and for 4,5 and 6 we are using AxisFault.makeFault(e).
>>
>>Are we right?
>>Nimalan
>>
>>    
>>
>>>looks ok. PLEASE from next time, make incremental changes and make
>>>them directly to CVS. PLEASE don't work off-line like you did this
>>>time. I fixed a lot of loose ends as well, for example you were
>>>swallowing exceptions, and i changed them to "throw
>>>AxisFault.makeFault()" etc...i'll have start all over again. If you
>>>are doing massive changes, then it's your responsibility to merge any
>>>and every change in CVS with your copy. We all are co-owners of the
>>>code and should work collectively.
>>>
>>>thanks,
>>>dims
>>>
>>>On Thu, 6 May 2004 11:36:32 -0400 (EDT), snimalan@opensource.lk
>>><sn...@opensource.lk> wrote:
>>>      
>>>
>>>>Hi Dims,
>>>>
>>>>We have finalized all development work relating to classes with basic
>>>>functionality for WSRM. So, our next commit will make lot of changes to
>>>>the existing classes . To keep your formatting in existing classes, we
>>>>were going through the formatting you did and formatted the new classes
>>>>accordingly.
>>>>We have concerned on the following aspects of formatting.
>>>>1.      Licenses
>>>>2.      Author
>>>>3.      Fields Comments
>>>>4.      Method Comments
>>>>
>>>>Please glance through sample class as shown below and send let us know
>>>>whether it is ok to commit as mentioned.
>>>>
>>>>Regards
>>>>Sandesha Team
>>>>
>>>> ---------------------------------------------------------------------------
>>>>/*
>>>> * Copyright  1999-2004 The Apache Software Foundation.
>>>> *
>>>> *  Licensed under the Apache License, Version 2.0 (the "License");
>>>> *  you may not use this file except in compliance with the License.
>>>> *  You may obtain a copy of the License at
>>>> *
>>>> *      http://www.apache.org/licenses/LICENSE-2.0
>>>> *
>>>> *  Unless required by applicable law or agreed to in writing, software
>>>> *  distributed under the License is distributed on an "AS IS" BASIS,
>>>> *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
>>>>implied.
>>>> *  See the License for the specific language governing permissions and
>>>> *  limitations under the License.
>>>> *
>>>> */
>>>>
>>>>package org.apache.sandesha.client;
>>>>
>>>>import org.apache.axis.message.addressing.MessageID;
>>>>
>>>>import org.apache.sandesha.RMMessage;
>>>>import org.apache.sandesha.RMSequence;
>>>>import org.apache.sandesha.ws.utility.Identifier;
>>>>
>>>>import java.util.HashMap;
>>>>import java.util.Map;
>>>>
>>>>/**
>>>> * @author
>>>> * Amila Navarathna<br>
>>>> * Jaliya Ekanayaka<br>
>>>> * Sudar Nimalan<br>
>>>> * (Apache Sandesha Project)
>>>> *
>>>> */
>>>>public class ClientMessageController {
>>>>        /**
>>>>         * Field instance
>>>>         */
>>>>    private static ClientMessageController instance;
>>>>        /**
>>>>         * Field messageMap
>>>>         */
>>>>    private Map messageMap;
>>>>        /**
>>>>         * Field sequenceMap
>>>>         */
>>>>    private Map sequenceMap;
>>>>        /**
>>>>         * Field seqAck
>>>>         */
>>>>
>>>>    private Identifier sequenceIdentifier;
>>>>
>>>>        /**
>>>>         * Constructor ClientMessageController
>>>>         */
>>>>    private ClientMessageController() {
>>>>        sequenceMap = new HashMap();
>>>>        messageMap = new HashMap();
>>>>    }
>>>>
>>>>        /**
>>>>         * Method getInstance
>>>>         *
>>>>         * @return ClientMessageController
>>>>         */
>>>>     public static ClientMessageController getInstance() {
>>>>
>>>>        if (instance == null) {
>>>>            instance = new ClientMessageController();
>>>>        }
>>>>
>>>>        return instance;
>>>>    }
>>>>
>>>>        /**
>>>>         * Method retrieveIfMessageExists
>>>>         *
>>>>         * returns a RMMessage if a message for the message id exists.
>>>>         * else return a null value
>>>>         * <b>developer must handle the null value returned</b>
>>>>         *
>>>>         * @param messageID
>>>>         * @return RMMessage
>>>>         *
>>>>         *
>>>>         */
>>>>
>>>>    public RMMessage retrieveIfMessageExists(MessageID messageID) {
>>>>        RMMessage rmMessage =
>>>>(RMMessage)messageMap.get(messageID.toString());
>>>>        if (rmMessage!= null) {
>>>>            return rmMessage;
>>>>        } else {
>>>>            return null;
>>>>        }
>>>>    }
>>>>
>>>>    /**
>>>>     * Method storeSequence
>>>>     *
>>>>     * stores a sequence object in the map. Each of these sequence
>>>>objects
>>>>     * consists of one or more message objects.
>>>>     * The sequences are stored as the sequenceIdentifier as a key
>>>>     *
>>>>     * @param sequence
>>>>     *
>>>>     *
>>>>     */
>>>>    public void storeSequence(RMSequence sequence) {
>>>>        //System.out.println("----------------storeSequence::"+sequence.getSequenceIdetifer());
>>>>        sequenceMap.put(sequence.getSequenceIdetifer().toString(),
>>>>sequence);
>>>>    }
>>>>
>>>>        /**
>>>>         * Method storeMessage
>>>>         *
>>>>         * stores a message object in the map.
>>>>         * The message are stored as the message id as a key
>>>>         *
>>>>         * @param message
>>>>         *
>>>>         *
>>>>         */
>>>>
>>>>    public void storeMessage(RMMessage message) {
>>>>        messageMap.put(message.getMessageID().toString(), message);
>>>>    }
>>>>
>>>>    /**
>>>>     * Method retrieveIfSequenceExists
>>>>     *
>>>>     * returns a RMSequence if a sequence for the identifier exists.
>>>>     * else return a null value
>>>>     * <b>developer must handle the null value returned</b>
>>>>     * @param identifier
>>>>     *
>>>>     * @return RMSequence
>>>>     *
>>>>     *
>>>>     */
>>>>    public RMSequence retrieveIfSequenceExists(Identifier identifier) {
>>>>        RMSequence rmSequence =
>>>>(RMSequence)sequenceMap.get(identifier.getIdentifier().toString());
>>>>        if (rmSequence != null) {
>>>>            return rmSequence;
>>>>        } else {
>>>>            return null;
>>>>        }
>>>>    }
>>>>
>>>>        /**
>>>>         * Method removeIfSequenceExists
>>>>         *
>>>>         * Search for a sequence and if it exists(means it is in the
>>>>map),
>>>>         * remove it from the map
>>>>         *
>>>>         * @param identifier
>>>>         *
>>>>         *
>>>>         */
>>>>        public void removeIfSequenceExists(Identifier identifier) {
>>>>                if (sequenceMap.get(identifier.toString()) != null) {
>>>>                        sequenceMap.remove(identifier.toString());
>>>>                }
>>>>        }
>>>>        /**
>>>>         * Method getSequenceIdentifier
>>>>         *
>>>>         * @return Identifier
>>>>         */
>>>>        public Identifier getSequenceIdentifier() {
>>>>                return sequenceIdentifier;
>>>>        }
>>>>
>>>>        /**
>>>>         * Method setSequenceIdentifier
>>>>         *
>>>>         * @param  identifier
>>>>         *
>>>>         */
>>>>        public void setSequenceIdentifier(Identifier identifier) {
>>>>                sequenceIdentifier = identifier;
>>>>        }
>>>>
>>>>}
>>>>
>>>>----------------------------------------
>>>>
>>>>
>>>>        
>>>>
>>>      
>>>
>>    
>>


-- 
The best way to predict the future is to invent it - Alan Kay


Re: Sandesha Exception Handling

Posted by Davanum Srinivas <da...@gmail.com>.
Nimalan,

Please do a compare with existing code in cvs (use a tool like windiff
or equivalent). I don't remember from the top of my head.

thanks,
dims

On Thu, 6 May 2004 13:29:39 -0400 (EDT), snimalan@opensource.lk
<sn...@opensource.lk> wrote:
> 
> Hi Dims,
> Now we are having catch blocks only in follwing classes.
> 1. RMSequence
> 2. RMClientService
> 3. MessageInserter
> 4. RMClientRequestHandler
> 5. RMClientResponseHandler
> 6. RMServerRequestHandler
> 
> When we are handling the exception for 1,2 and 3 we are using log.error(e)
> and for 4,5 and 6 we are using AxisFault.makeFault(e).
> 
> Are we right?
> Nimalan
> 
> > looks ok. PLEASE from next time, make incremental changes and make
> > them directly to CVS. PLEASE don't work off-line like you did this
> > time. I fixed a lot of loose ends as well, for example you were
> > swallowing exceptions, and i changed them to "throw
> > AxisFault.makeFault()" etc...i'll have start all over again. If you
> > are doing massive changes, then it's your responsibility to merge any
> > and every change in CVS with your copy. We all are co-owners of the
> > code and should work collectively.
> >
> > thanks,
> > dims
> >
> > On Thu, 6 May 2004 11:36:32 -0400 (EDT), snimalan@opensource.lk
> > <sn...@opensource.lk> wrote:
> >>
> >> Hi Dims,
> >>
> >> We have finalized all development work relating to classes with basic
> >> functionality for WSRM. So, our next commit will make lot of changes to
> >> the existing classes . To keep your formatting in existing classes, we
> >> were going through the formatting you did and formatted the new classes
> >> accordingly.
> >> We have concerned on the following aspects of formatting.
> >> 1.      Licenses
> >> 2.      Author
> >> 3.      Fields Comments
> >> 4.      Method Comments
> >>
> >> Please glance through sample class as shown below and send let us know
> >> whether it is ok to commit as mentioned.
> >>
> >> Regards
> >> Sandesha Team
> >>
> >>  ---------------------------------------------------------------------------
> >> /*
> >>  * Copyright  1999-2004 The Apache Software Foundation.
> >>  *
> >>  *  Licensed under the Apache License, Version 2.0 (the "License");
> >>  *  you may not use this file except in compliance with the License.
> >>  *  You may obtain a copy of the License at
> >>  *
> >>  *      http://www.apache.org/licenses/LICENSE-2.0
> >>  *
> >>  *  Unless required by applicable law or agreed to in writing, software
> >>  *  distributed under the License is distributed on an "AS IS" BASIS,
> >>  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
> >> implied.
> >>  *  See the License for the specific language governing permissions and
> >>  *  limitations under the License.
> >>  *
> >>  */
> >>
> >> package org.apache.sandesha.client;
> >>
> >> import org.apache.axis.message.addressing.MessageID;
> >>
> >> import org.apache.sandesha.RMMessage;
> >> import org.apache.sandesha.RMSequence;
> >> import org.apache.sandesha.ws.utility.Identifier;
> >>
> >> import java.util.HashMap;
> >> import java.util.Map;
> >>
> >> /**
> >>  * @author
> >>  * Amila Navarathna<br>
> >>  * Jaliya Ekanayaka<br>
> >>  * Sudar Nimalan<br>
> >>  * (Apache Sandesha Project)
> >>  *
> >>  */
> >> public class ClientMessageController {
> >>         /**
> >>          * Field instance
> >>          */
> >>     private static ClientMessageController instance;
> >>         /**
> >>          * Field messageMap
> >>          */
> >>     private Map messageMap;
> >>         /**
> >>          * Field sequenceMap
> >>          */
> >>     private Map sequenceMap;
> >>         /**
> >>          * Field seqAck
> >>          */
> >>
> >>     private Identifier sequenceIdentifier;
> >>
> >>         /**
> >>          * Constructor ClientMessageController
> >>          */
> >>     private ClientMessageController() {
> >>         sequenceMap = new HashMap();
> >>         messageMap = new HashMap();
> >>     }
> >>
> >>         /**
> >>          * Method getInstance
> >>          *
> >>          * @return ClientMessageController
> >>          */
> >>      public static ClientMessageController getInstance() {
> >>
> >>         if (instance == null) {
> >>             instance = new ClientMessageController();
> >>         }
> >>
> >>         return instance;
> >>     }
> >>
> >>         /**
> >>          * Method retrieveIfMessageExists
> >>          *
> >>          * returns a RMMessage if a message for the message id exists.
> >>          * else return a null value
> >>          * <b>developer must handle the null value returned</b>
> >>          *
> >>          * @param messageID
> >>          * @return RMMessage
> >>          *
> >>          *
> >>          */
> >>
> >>     public RMMessage retrieveIfMessageExists(MessageID messageID) {
> >>         RMMessage rmMessage =
> >> (RMMessage)messageMap.get(messageID.toString());
> >>         if (rmMessage!= null) {
> >>             return rmMessage;
> >>         } else {
> >>             return null;
> >>         }
> >>     }
> >>
> >>     /**
> >>      * Method storeSequence
> >>      *
> >>      * stores a sequence object in the map. Each of these sequence
> >> objects
> >>      * consists of one or more message objects.
> >>      * The sequences are stored as the sequenceIdentifier as a key
> >>      *
> >>      * @param sequence
> >>      *
> >>      *
> >>      */
> >>     public void storeSequence(RMSequence sequence) {
> >>         //System.out.println("----------------storeSequence::"+sequence.getSequenceIdetifer());
> >>         sequenceMap.put(sequence.getSequenceIdetifer().toString(),
> >> sequence);
> >>     }
> >>
> >>         /**
> >>          * Method storeMessage
> >>          *
> >>          * stores a message object in the map.
> >>          * The message are stored as the message id as a key
> >>          *
> >>          * @param message
> >>          *
> >>          *
> >>          */
> >>
> >>     public void storeMessage(RMMessage message) {
> >>         messageMap.put(message.getMessageID().toString(), message);
> >>     }
> >>
> >>     /**
> >>      * Method retrieveIfSequenceExists
> >>      *
> >>      * returns a RMSequence if a sequence for the identifier exists.
> >>      * else return a null value
> >>      * <b>developer must handle the null value returned</b>
> >>      * @param identifier
> >>      *
> >>      * @return RMSequence
> >>      *
> >>      *
> >>      */
> >>     public RMSequence retrieveIfSequenceExists(Identifier identifier) {
> >>         RMSequence rmSequence =
> >> (RMSequence)sequenceMap.get(identifier.getIdentifier().toString());
> >>         if (rmSequence != null) {
> >>             return rmSequence;
> >>         } else {
> >>             return null;
> >>         }
> >>     }
> >>
> >>         /**
> >>          * Method removeIfSequenceExists
> >>          *
> >>          * Search for a sequence and if it exists(means it is in the
> >> map),
> >>          * remove it from the map
> >>          *
> >>          * @param identifier
> >>          *
> >>          *
> >>          */
> >>         public void removeIfSequenceExists(Identifier identifier) {
> >>                 if (sequenceMap.get(identifier.toString()) != null) {
> >>                         sequenceMap.remove(identifier.toString());
> >>                 }
> >>         }
> >>         /**
> >>          * Method getSequenceIdentifier
> >>          *
> >>          * @return Identifier
> >>          */
> >>         public Identifier getSequenceIdentifier() {
> >>                 return sequenceIdentifier;
> >>         }
> >>
> >>         /**
> >>          * Method setSequenceIdentifier
> >>          *
> >>          * @param  identifier
> >>          *
> >>          */
> >>         public void setSequenceIdentifier(Identifier identifier) {
> >>                 sequenceIdentifier = identifier;
> >>         }
> >>
> >> }
> >>
> >> ----------------------------------------
> >>
> >>
> >
> >
> 
>

Sandesha Exception Handling

Posted by sn...@opensource.lk.
Hi Dims,
Now we are having catch blocks only in follwing classes.
1. RMSequence
2. RMClientService
3. MessageInserter
4. RMClientRequestHandler
5. RMClientResponseHandler
6. RMServerRequestHandler

When we are handling the exception for 1,2 and 3 we are using log.error(e)
and for 4,5 and 6 we are using AxisFault.makeFault(e).

Are we right?
Nimalan


> looks ok. PLEASE from next time, make incremental changes and make
> them directly to CVS. PLEASE don't work off-line like you did this
> time. I fixed a lot of loose ends as well, for example you were
> swallowing exceptions, and i changed them to "throw
> AxisFault.makeFault()" etc...i'll have start all over again. If you
> are doing massive changes, then it's your responsibility to merge any
> and every change in CVS with your copy. We all are co-owners of the
> code and should work collectively.
>
> thanks,
> dims
>
> On Thu, 6 May 2004 11:36:32 -0400 (EDT), snimalan@opensource.lk
> <sn...@opensource.lk> wrote:
>>
>> Hi Dims,
>>
>> We have finalized all development work relating to classes with basic
>> functionality for WSRM. So, our next commit will make lot of changes to
>> the existing classes . To keep your formatting in existing classes, we
>> were going through the formatting you did and formatted the new classes
>> accordingly.
>> We have concerned on the following aspects of formatting.
>> 1.      Licenses
>> 2.      Author
>> 3.      Fields Comments
>> 4.      Method Comments
>>
>> Please glance through sample class as shown below and send let us know
>> whether it is ok to commit as mentioned.
>>
>> Regards
>> Sandesha Team
>>
>>  ---------------------------------------------------------------------------
>> /*
>>  * Copyright  1999-2004 The Apache Software Foundation.
>>  *
>>  *  Licensed under the Apache License, Version 2.0 (the "License");
>>  *  you may not use this file except in compliance with the License.
>>  *  You may obtain a copy of the License at
>>  *
>>  *      http://www.apache.org/licenses/LICENSE-2.0
>>  *
>>  *  Unless required by applicable law or agreed to in writing, software
>>  *  distributed under the License is distributed on an "AS IS" BASIS,
>>  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
>> implied.
>>  *  See the License for the specific language governing permissions and
>>  *  limitations under the License.
>>  *
>>  */
>>
>> package org.apache.sandesha.client;
>>
>> import org.apache.axis.message.addressing.MessageID;
>>
>> import org.apache.sandesha.RMMessage;
>> import org.apache.sandesha.RMSequence;
>> import org.apache.sandesha.ws.utility.Identifier;
>>
>> import java.util.HashMap;
>> import java.util.Map;
>>
>> /**
>>  * @author
>>  * Amila Navarathna<br>
>>  * Jaliya Ekanayaka<br>
>>  * Sudar Nimalan<br>
>>  * (Apache Sandesha Project)
>>  *
>>  */
>> public class ClientMessageController {
>>         /**
>>          * Field instance
>>          */
>>     private static ClientMessageController instance;
>>         /**
>>          * Field messageMap
>>          */
>>     private Map messageMap;
>>         /**
>>          * Field sequenceMap
>>          */
>>     private Map sequenceMap;
>>         /**
>>          * Field seqAck
>>          */
>>
>>     private Identifier sequenceIdentifier;
>>
>>         /**
>>          * Constructor ClientMessageController
>>          */
>>     private ClientMessageController() {
>>         sequenceMap = new HashMap();
>>         messageMap = new HashMap();
>>     }
>>
>>         /**
>>          * Method getInstance
>>          *
>>          * @return ClientMessageController
>>          */
>>      public static ClientMessageController getInstance() {
>>
>>         if (instance == null) {
>>             instance = new ClientMessageController();
>>         }
>>
>>         return instance;
>>     }
>>
>>         /**
>>          * Method retrieveIfMessageExists
>>          *
>>          * returns a RMMessage if a message for the message id exists.
>>          * else return a null value
>>          * <b>developer must handle the null value returned</b>
>>          *
>>          * @param messageID
>>          * @return RMMessage
>>          *
>>          *
>>          */
>>
>>     public RMMessage retrieveIfMessageExists(MessageID messageID) {
>>         RMMessage rmMessage =
>> (RMMessage)messageMap.get(messageID.toString());
>>         if (rmMessage!= null) {
>>             return rmMessage;
>>         } else {
>>             return null;
>>         }
>>     }
>>
>>     /**
>>      * Method storeSequence
>>      *
>>      * stores a sequence object in the map. Each of these sequence
>> objects
>>      * consists of one or more message objects.
>>      * The sequences are stored as the sequenceIdentifier as a key
>>      *
>>      * @param sequence
>>      *
>>      *
>>      */
>>     public void storeSequence(RMSequence sequence) {
>>         //System.out.println("----------------storeSequence::"+sequence.getSequenceIdetifer());
>>         sequenceMap.put(sequence.getSequenceIdetifer().toString(),
>> sequence);
>>     }
>>
>>         /**
>>          * Method storeMessage
>>          *
>>          * stores a message object in the map.
>>          * The message are stored as the message id as a key
>>          *
>>          * @param message
>>          *
>>          *
>>          */
>>
>>     public void storeMessage(RMMessage message) {
>>         messageMap.put(message.getMessageID().toString(), message);
>>     }
>>
>>     /**
>>      * Method retrieveIfSequenceExists
>>      *
>>      * returns a RMSequence if a sequence for the identifier exists.
>>      * else return a null value
>>      * <b>developer must handle the null value returned</b>
>>      * @param identifier
>>      *
>>      * @return RMSequence
>>      *
>>      *
>>      */
>>     public RMSequence retrieveIfSequenceExists(Identifier identifier) {
>>         RMSequence rmSequence =
>> (RMSequence)sequenceMap.get(identifier.getIdentifier().toString());
>>         if (rmSequence != null) {
>>             return rmSequence;
>>         } else {
>>             return null;
>>         }
>>     }
>>
>>         /**
>>          * Method removeIfSequenceExists
>>          *
>>          * Search for a sequence and if it exists(means it is in the
>> map),
>>          * remove it from the map
>>          *
>>          * @param identifier
>>          *
>>          *
>>          */
>>         public void removeIfSequenceExists(Identifier identifier) {
>>                 if (sequenceMap.get(identifier.toString()) != null) {
>>                         sequenceMap.remove(identifier.toString());
>>                 }
>>         }
>>         /**
>>          * Method getSequenceIdentifier
>>          *
>>          * @return Identifier
>>          */
>>         public Identifier getSequenceIdentifier() {
>>                 return sequenceIdentifier;
>>         }
>>
>>         /**
>>          * Method setSequenceIdentifier
>>          *
>>          * @param  identifier
>>          *
>>          */
>>         public void setSequenceIdentifier(Identifier identifier) {
>>                 sequenceIdentifier = identifier;
>>         }
>>
>> }
>>
>> ----------------------------------------
>>
>>
>
>


Re: Sandesha code format

Posted by Davanum Srinivas <da...@gmail.com>.
looks ok. PLEASE from next time, make incremental changes and make
them directly to CVS. PLEASE don't work off-line like you did this
time. I fixed a lot of loose ends as well, for example you were
swallowing exceptions, and i changed them to "throw
AxisFault.makeFault()" etc...i'll have start all over again. If you
are doing massive changes, then it's your responsibility to merge any
and every change in CVS with your copy. We all are co-owners of the
code and should work collectively.

thanks,
dims

On Thu, 6 May 2004 11:36:32 -0400 (EDT), snimalan@opensource.lk
<sn...@opensource.lk> wrote:
> 
> Hi Dims,
> 
> We have finalized all development work relating to classes with basic
> functionality for WSRM. So, our next commit will make lot of changes to
> the existing classes . To keep your formatting in existing classes, we
> were going through the formatting you did and formatted the new classes
> accordingly.
> We have concerned on the following aspects of formatting.
> 1.      Licenses
> 2.      Author
> 3.      Fields Comments
> 4.      Method Comments
> 
> Please glance through sample class as shown below and send let us know
> whether it is ok to commit as mentioned.
> 
> Regards
> Sandesha Team
> 
>  ---------------------------------------------------------------------------
> /*
>  * Copyright  1999-2004 The Apache Software Foundation.
>  *
>  *  Licensed under the Apache License, Version 2.0 (the "License");
>  *  you may not use this file except in compliance with the License.
>  *  You may obtain a copy of the License at
>  *
>  *      http://www.apache.org/licenses/LICENSE-2.0
>  *
>  *  Unless required by applicable law or agreed to in writing, software
>  *  distributed under the License is distributed on an "AS IS" BASIS,
>  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
>  *  See the License for the specific language governing permissions and
>  *  limitations under the License.
>  *
>  */
> 
> package org.apache.sandesha.client;
> 
> import org.apache.axis.message.addressing.MessageID;
> 
> import org.apache.sandesha.RMMessage;
> import org.apache.sandesha.RMSequence;
> import org.apache.sandesha.ws.utility.Identifier;
> 
> import java.util.HashMap;
> import java.util.Map;
> 
> /**
>  * @author
>  * Amila Navarathna<br>
>  * Jaliya Ekanayaka<br>
>  * Sudar Nimalan<br>
>  * (Apache Sandesha Project)
>  *
>  */
> public class ClientMessageController {
>         /**
>          * Field instance
>          */
>     private static ClientMessageController instance;
>         /**
>          * Field messageMap
>          */
>     private Map messageMap;
>         /**
>          * Field sequenceMap
>          */
>     private Map sequenceMap;
>         /**
>          * Field seqAck
>          */
> 
>     private Identifier sequenceIdentifier;
> 
>         /**
>          * Constructor ClientMessageController
>          */
>     private ClientMessageController() {
>         sequenceMap = new HashMap();
>         messageMap = new HashMap();
>     }
> 
>         /**
>          * Method getInstance
>          *
>          * @return ClientMessageController
>          */
>      public static ClientMessageController getInstance() {
> 
>         if (instance == null) {
>             instance = new ClientMessageController();
>         }
> 
>         return instance;
>     }
> 
>         /**
>          * Method retrieveIfMessageExists
>          *
>          * returns a RMMessage if a message for the message id exists.
>          * else return a null value
>          * <b>developer must handle the null value returned</b>
>          *
>          * @param messageID
>          * @return RMMessage
>          *
>          *
>          */
> 
>     public RMMessage retrieveIfMessageExists(MessageID messageID) {
>         RMMessage rmMessage = (RMMessage)messageMap.get(messageID.toString());
>         if (rmMessage!= null) {
>             return rmMessage;
>         } else {
>             return null;
>         }
>     }
> 
>     /**
>      * Method storeSequence
>      *
>      * stores a sequence object in the map. Each of these sequence objects
>      * consists of one or more message objects.
>      * The sequences are stored as the sequenceIdentifier as a key
>      *
>      * @param sequence
>      *
>      *
>      */
>     public void storeSequence(RMSequence sequence) {
>         //System.out.println("----------------storeSequence::"+sequence.getSequenceIdetifer());
>         sequenceMap.put(sequence.getSequenceIdetifer().toString(), sequence);
>     }
> 
>         /**
>          * Method storeMessage
>          *
>          * stores a message object in the map.
>          * The message are stored as the message id as a key
>          *
>          * @param message
>          *
>          *
>          */
> 
>     public void storeMessage(RMMessage message) {
>         messageMap.put(message.getMessageID().toString(), message);
>     }
> 
>     /**
>      * Method retrieveIfSequenceExists
>      *
>      * returns a RMSequence if a sequence for the identifier exists.
>      * else return a null value
>      * <b>developer must handle the null value returned</b>
>      * @param identifier
>      *
>      * @return RMSequence
>      *
>      *
>      */
>     public RMSequence retrieveIfSequenceExists(Identifier identifier) {
>         RMSequence rmSequence =
> (RMSequence)sequenceMap.get(identifier.getIdentifier().toString());
>         if (rmSequence != null) {
>             return rmSequence;
>         } else {
>             return null;
>         }
>     }
> 
>         /**
>          * Method removeIfSequenceExists
>          *
>          * Search for a sequence and if it exists(means it is in the map),
>          * remove it from the map
>          *
>          * @param identifier
>          *
>          *
>          */
>         public void removeIfSequenceExists(Identifier identifier) {
>                 if (sequenceMap.get(identifier.toString()) != null) {
>                         sequenceMap.remove(identifier.toString());
>                 }
>         }
>         /**
>          * Method getSequenceIdentifier
>          *
>          * @return Identifier
>          */
>         public Identifier getSequenceIdentifier() {
>                 return sequenceIdentifier;
>         }
> 
>         /**
>          * Method setSequenceIdentifier
>          *
>          * @param  identifier
>          *
>          */
>         public void setSequenceIdentifier(Identifier identifier) {
>                 sequenceIdentifier = identifier;
>         }
> 
> }
> 
> ----------------------------------------
> 
>

cvs udpate ...

Posted by Aleksander Slominski <as...@cs.indiana.edu>.
snimalan@opensource.lk wrote:

>We have finalized all development work relating to classes with basic
>functionality for WSRM. So, our next commit will make lot of changes to
>the existing classes . 
>  
>
hi,

did you run cvs update after cvs commit and verified that code still 
compiles?

it seems to me that you had commited a duplicate code in 
ServerMessageController that prevented ant from code compiling see below 
or it was meged in cvs update.

i have fixed it now.

alek

C:\Forge\ws-apache-cvs\ws-fx\sandesha>ant compile
JAVA=c:\j2sdk1.4.2\bin\java.exe
Buildfile: build.xml

init:
     [echo] 
-------------------------------------------------------------------
     [echo] -------------- Apache-Sandesha-J v1.0.Beta2 [2004] 
----------------
     [echo] 
-------------------------------------------------------------------
     [echo] Building with Apache Ant version 1.5.2 compiled on February 
28 2003
     [echo] using build file C:\Forge\ws-apache-cvs\ws-fx\sandesha\build.xml
     [echo] Java 1.4.2 located at c:\j2sdk1.4.2\jre
     [echo] 
-------------------------------------------------------------------
     [echo] --- Property values ---
     [echo] 
sun.boot.class.path=c:\j2sdk1.4.2\jre\lib\endorsed\xalan.jar;c:\j2sd
k1.4.2\jre\lib\rt.jar;c:\j2sdk1.4.2\jre\lib\i18n.jar;c:\j2sdk1.4.2\jre\lib\sunrs
asign.jar;c:\j2sdk1.4.2\jre\lib\jsse.jar;c:\j2sdk1.4.2\jre\lib\jce.jar;c:\j2sdk1
.4.2\jre\lib\charsets.jar;c:\j2sdk1.4.2\jre\classes
     [echo] classpath.test: 
C:\Forge\ws-apache-cvs\ws-fx\sandesha\build\classes;
C:\Forge\ws-apache-cvs\ws-fx\sandesha\build\sandesha.jar;C:\Forge\ws-apache-cvs\
ws-fx\sandesha\lib\addressing-1.0.jar;C:\Forge\ws-apache-cvs\ws-fx\sandesha\lib\
axis-ant.jar;C:\Forge\ws-apache-cvs\ws-fx\sandesha\lib\axis.jar;C:\Forge\ws-apac
he-cvs\ws-fx\sandesha\lib\commons-discovery.jar;C:\Forge\ws-apache-cvs\ws-fx\san
desha\lib\commons-logging.jar;C:\Forge\ws-apache-cvs\ws-fx\sandesha\lib\jaxrpc.j
ar;C:\Forge\ws-apache-cvs\ws-fx\sandesha\lib\junit-3.8.1.jar;C:\Forge\ws-apache-
cvs\ws-fx\sandesha\lib\log4j-1.2.8.jar;C:\Forge\ws-apache-cvs\ws-fx\sandesha\lib
\saaj.jar;C:\Forge\ws-apache-cvs\ws-fx\sandesha\lib\wsdl4j.jar;C:\Forge\ws-apach
e-cvs\ws-fx\sandesha\lib\xalan.jar;C:\Forge\ws-apache-cvs\ws-fx\sandesha\lib\xer
cesImpl.jar;C:\Forge\ws-apache-cvs\ws-fx\sandesha\lib\xml-apis.jar;C:\j2sdk1.4.2
\lib\tools.jar;C:\OffNet\tools\apache-ant-1.5.2\lib\xml-apis.jar;C:\OffNet\tools
\apache-ant-1.5.2\lib\xercesImpl.jar;C:\OffNet\tools\apache-ant-1.5.2\lib\option
al.jar;C:\OffNet\tools\apache-ant-1.5.2\lib\junit3.8.1.jar;C:\OffNet\tools\apach
e-ant-1.5.2\lib\jsr14adapter-1.2.jar;C:\OffNet\tools\apache-ant-1.5.2\lib\ant.ja
r;C:\OffNet\tools\apache-ant-1.5.2\lib\ant-greebo-0.1beta.jar


prepare:
    [mkdir] Created dir: C:\Forge\ws-apache-cvs\ws-fx\sandesha\build
    [mkdir] Created dir: 
C:\Forge\ws-apache-cvs\ws-fx\sandesha\build\test-report
s
     [echo] --- Flags (Note: If the {property name} is displayed,
     [echo]            then the component is not present)
     [echo] jdk14.present=true
     [echo] jdk15.present=${jdk15.present}
     [echo] bc.present=${bc.present}

prepare-src:
    [mkdir] Created dir: C:\Forge\ws-apache-cvs\ws-fx\sandesha\build\classes

compile.library:
    [javac] Compiling 26 source files to 
C:\Forge\ws-apache-cvs\ws-fx\sandesha\b
uild\classes
    [javac] 
C:\Forge\ws-apache-cvs\ws-fx\sandesha\src\org\apache\sandesha\server
\ServerMessageController.java:167: 'class' or 'interface' expected
    [javac] package org.apache.sandesha.server;
    [javac] ^
    [javac] 
C:\Forge\ws-apache-cvs\ws-fx\sandesha\src\org\apache\sandesha\server
\ServerMessageController.java:169: 'class' or 'interface' expected
    [javac] import org.apache.sandesha.RMMessage;
    [javac] ^
    [javac] 
C:\Forge\ws-apache-cvs\ws-fx\sandesha\src\org\apache\sandesha\server
\ServerMessageController.java:170: 'class' or 'interface' expected
    [javac] import org.apache.sandesha.RMSequence;
    [javac] ^
    [javac] 
C:\Forge\ws-apache-cvs\ws-fx\sandesha\src\org\apache\sandesha\server
\ServerMessageController.java:171: 'class' or 'interface' expected
    [javac] import org.apache.sandesha.ws.rm.SequenceAcknowledgement;
    [javac] ^
    [javac] 
C:\Forge\ws-apache-cvs\ws-fx\sandesha\src\org\apache\sandesha\server
\ServerMessageController.java:172: 'class' or 'interface' expected
    [javac] import org.apache.sandesha.ws.utility.Identifier;
    [javac] ^
    [javac] 
C:\Forge\ws-apache-cvs\ws-fx\sandesha\src\org\apache\sandesha\server
\ServerMessageController.java:174: 'class' or 'interface' expected
    [javac] import java.util.HashMap;
    [javac] ^
    [javac] 
C:\Forge\ws-apache-cvs\ws-fx\sandesha\src\org\apache\sandesha\server
\ServerMessageController.java:175: 'class' or 'interface' expected
    [javac] import java.util.Map;
    [javac] ^
    [javac] 7 errors

BUILD FAILED
file:C:/Forge/ws-apache-cvs/ws-fx/sandesha/build.xml:316: Compile 
failed; see th
e compiler error output for details.

Total time: 3 seconds
C:\Forge\ws-apache-cvs\ws-fx\sandesha>

-- 
The best way to predict the future is to invent it - Alan Kay


[sandesha] running interop client

Posted by Aleksander Slominski <as...@cs.indiana.edu>.
hi,

i thin that a special client.wsdd needs to be used to have WSRM handler injected (?!) to get sample 
running. is it documented somewhere and/or example wsdd file is available?

my naive attempt to run directly Scenario_1_1_Client ends in NPE.

thanks,

alek

"C:\j2sdk1.4.2\bin\javaw.exe" -classpath 
"C:\Forge\ws-apache-cvs\ws-fx\sandesha\build.cpr\;C:\Forge\ws-apache-cvs\ws-fx\sandesha\lib\addressing-1.0.jar;C:\Forge\ws-apache-cvs\ws-fx\sandesha\lib\axis-ant.jar;C:\Forge\ws-apache-cvs\ws-fx\sandesha\lib\axis.jar;C:\Forge\ws-apache-cvs\ws-fx\sandesha\lib\commons-discovery.jar;C:\Forge\ws-apache-cvs\ws-fx\sandesha\lib\commons-logging.jar;C:\Forge\ws-apache-cvs\ws-fx\sandesha\lib\jaxrpc.jar;C:\Forge\ws-apache-cvs\ws-fx\sandesha\lib\junit-3.8.1.jar;C:\Forge\ws-apache-cvs\ws-fx\sandesha\lib\log4j-1.2.8.jar;C:\Forge\ws-apache-cvs\ws-fx\sandesha\lib\saaj.jar;C:\Forge\ws-apache-cvs\ws-fx\sandesha\lib\wsdl4j.jar;C:\Forge\ws-apache-cvs\ws-fx\sandesha\lib\xalan.jar;C:\Forge\ws-apache-cvs\ws-fx\sandesha\lib\xercesImpl.jar;C:\Forge\ws-apache-cvs\ws-fx\sandesha\lib\xml-apis.jar" 
org.apache.sandesha.samples.interop.Scenario_1_1_Client http://soap.systinet.net/ws/wsrm/ping
Client started......
log4j:WARN No appenders could be found for logger (org.apache.axis.i18n.ProjectResourceBundle).
log4j:WARN Please initialize the log4j system properly.
AxisFault
  faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
  faultSubcode:
  faultString: java.lang.NullPointerException
  faultActor:
  faultNode:
  faultDetail:
	{http://xml.apache.org/axis/}stackTrace:java.lang.NullPointerException
	at org.apache.axis.utils.ByteArray.writeTo(ByteArray.java:329)
	at org.apache.axis.SOAPPart.writeTo(SOAPPart.java:264)
	at org.apache.axis.Message.writeTo(Message.java:520)
	at org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.java:461)
	at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:87)
	at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
	at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
	at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
	at org.apache.axis.client.AxisClient.invoke(AxisClient.java:144)
	at org.apache.axis.client.Call.invokeEngine(Call.java:2710)
	at org.apache.axis.client.Call.invoke(Call.java:2693)
	at org.apache.axis.client.Call.invoke(Call.java:2378)
	at org.apache.axis.client.Call.invoke(Call.java:2301)
	at org.apache.axis.client.Call.invoke(Call.java:1762)
	at org.apache.sandesha.samples.interop.Scenario_1_1_Client.main(Scenario_1_1_Client.java:63)


java.lang.NullPointerException
	at org.apache.axis.AxisFault.makeFault(AxisFault.java:98)
	at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:96)
	at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
	at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
	at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
	at org.apache.axis.client.AxisClient.invoke(AxisClient.java:144)
	at org.apache.axis.client.Call.invokeEngine(Call.java:2710)
	at org.apache.axis.client.Call.invoke(Call.java:2693)
	at org.apache.axis.client.Call.invoke(Call.java:2378)
	at org.apache.axis.client.Call.invoke(Call.java:2301)
	at org.apache.axis.client.Call.invoke(Call.java:1762)
	at org.apache.sandesha.samples.interop.Scenario_1_1_Client.main(Scenario_1_1_Client.java:63)
Caused by: java.lang.NullPointerException
	at org.apache.axis.utils.ByteArray.writeTo(ByteArray.java:329)
	at org.apache.axis.SOAPPart.writeTo(SOAPPart.java:264)
	at org.apache.axis.Message.writeTo(Message.java:520)
	at org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.java:461)
	at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:87)
	... 10 more


Re: Sandesha code format

Posted by Davanum Srinivas <da...@gmail.com>.
and PLEASE try compiling the code BEFORE and AFTER checking code into
CVS. (AFTER checking implies, get the latest from CVS and work with
it)

thanks,
dims

On Fri, 07 May 2004 01:33:52 -0500, Aleksander Slominski
<as...@cs.indiana.edu> wrote:
> 
> snimalan@opensource.lk wrote:
> 
> >We have finalized all development work relating to classes with basic
> >functionality for WSRM. So, our next commit will make lot of changes to
> >the existing classes . To keep your formatting in existing classes, we
> >were going through the formatting you did and formatted the new classes
> >accordingly.
> >We have concerned on the following aspects of formatting.
> >1.     Licenses
> >2.     Author
> >3.     Fields Comments
> >4.     Method Comments
> >
> >
> please do not use TABs (ever!) and 4 space indent - which i think is
> used in majority of apache projects
> 
> thanks,
> 
> 
> 
> alek
> 
> --
> The best way to predict the future is to invent it - Alan Kay
> 
>

Re: Sandesha code format

Posted by Aleksander Slominski <as...@cs.indiana.edu>.
snimalan@opensource.lk wrote:

>We have finalized all development work relating to classes with basic
>functionality for WSRM. So, our next commit will make lot of changes to
>the existing classes . To keep your formatting in existing classes, we
>were going through the formatting you did and formatted the new classes
>accordingly.
>We have concerned on the following aspects of formatting.
>1.	Licenses
>2.	Author
>3.	Fields Comments
>4.	Method Comments
>  
>
please do not use TABs (ever!) and 4 space indent - which i think is 
used in majority of apache projects

thanks,

alek

-- 
The best way to predict the future is to invent it - Alan Kay