}
synchronized (contextMappings)
{
// next, unmarshall the mapping object
JipletContextMappings rmappings = (JipletContextMappings) JAXBContext
.newInstance("org.cafesip.jiplet.config.jip",
this.getClass().getClassLoader())
.createUnmarshaller().unmarshal(
new InputSource(new StringReader(mapping)));
// next remove any references to the context left from earlier
// deployment
Iterator i = contextMappings.getContextMapping().iterator();
while (i.hasNext() == true)
{
ContextMapping cmap = (ContextMapping) i.next();
if (cmap.getContext().equals(context) == true)
{
i.remove();
}
}
// copy the received map object into the cloned map object
i = rmappings.getContextMapping().iterator();
while (i.hasNext() == true)
{
ContextMapping m = (ContextMapping) i.next();
contextMappings.getContextMapping().add(m);
}