package ossj.common;

import javax.xml.bind.annotation.adapters.XmlAdapter;

import javax.oss.ApplicationContext;

/**
 *
 * @author pm200800
 */
public class ApplicationContextAdapter extends XmlAdapter<ApplicationContextImpl,ApplicationContext>{
    
    public ApplicationContext unmarshal(ApplicationContextImpl p) throws Exception {
        try {
            ApplicationContext r = p;
            return r;
        }
        catch (Exception e)
        {
            e.printStackTrace();
            String msg = "Unable to unmarshall ApplicationContext : "+p;
            throw new Exception(msg+" due to "+e);   
        }                
    }

    public ApplicationContextImpl marshal(ApplicationContext p) throws Exception {
        try {
            ApplicationContextImpl r = (ApplicationContextImpl)p;
            return r;
        }
        catch (Exception e)
        {
            e.printStackTrace();
            String msg = "Unable to marshall ApplicationContextImpl : "+p;
            throw new Exception(msg+" due to "+e);   
        } 
    }
    
}
