private Marshaller createMarshaller() throws JAXBException { JAXBContext jc = JaxbContextHandler.getEndpointContext(); return jc.createMarshaller(); }
@SuppressWarnings("unchecked") private EndpointReferenceType toEndPointReference(Element root) { EndpointReferenceType epr = null; if (root != null) { try { JAXBContext jc = JaxbContextHandler.getAddressingContext(); JAXBElement<EndpointReferenceType> eprElem = (JAXBElement<EndpointReferenceType>) jc.createUnmarshaller().unmarshal(root); epr = eprElem.getValue(); } catch (JAXBException e) { if (LOG.isLoggable(Level.SEVERE)) { LOG.log(Level.SEVERE, "Failed to deserialize endpoint reference", e); } } } else { LOG.log(Level.SEVERE, "No endpoint reference found in content"); } return epr != null ? epr : new EndpointReferenceType(); }
@SuppressWarnings("unchecked") private EndpointReferenceType toEndPointReference(Element root) { EndpointReferenceType epr = null; if (root != null) { try { JAXBContext jc = JaxbContextHandler.getAddressingContext(); JAXBElement<EndpointReferenceType> eprElem = (JAXBElement<EndpointReferenceType>) jc.createUnmarshaller().unmarshal(root); epr = eprElem.getValue(); } catch (JAXBException e) { if (LOG.isLoggable(Level.SEVERE)) { LOG.log(Level.SEVERE, "Failed to deserialize endpoint reference", e); } } } else { LOG.log(Level.SEVERE, "No endpoint reference found in content"); } return epr != null ? epr : new EndpointReferenceType(); }
private Marshaller createMarshaller() throws JAXBException { JAXBContext jc = JaxbContextHandler.getEndpointContext(); return jc.createMarshaller(); }
@SuppressWarnings("unchecked") private ServiceLocatorPropertiesType toServiceLocatorProperties(Element root) { try { JAXBContext jc = JaxbContextHandler.getEndpointContext(); JAXBElement<ServiceLocatorPropertiesType> slp = (JAXBElement<ServiceLocatorPropertiesType>) jc.createUnmarshaller().unmarshal(root); return slp.getValue(); } catch (JAXBException e) { if (LOG.isLoggable(Level.SEVERE)) { LOG.log(Level.SEVERE, "Failed to deserialize service locator properties", e); } return SL_OBJECT_FACTORY.createServiceLocatorPropertiesType(); } }
@SuppressWarnings("unchecked") private ServiceLocatorPropertiesType toServiceLocatorProperties(Element root) { try { JAXBContext jc = JaxbContextHandler.getEndpointContext(); JAXBElement<ServiceLocatorPropertiesType> slp = (JAXBElement<ServiceLocatorPropertiesType>) jc.createUnmarshaller().unmarshal(root); return slp.getValue(); } catch (JAXBException e) { if (LOG.isLoggable(Level.SEVERE)) { LOG.log(Level.SEVERE, "Failed to deserialize service locator properties", e); } return SL_OBJECT_FACTORY.createServiceLocatorPropertiesType(); } }
@SuppressWarnings("unchecked") public static EndpointDataType toEndPointData(byte[] content) { if (content == null) { throw new IllegalArgumentException("content must not be null."); } final InputStream is = new ByteArrayInputStream(content); try { JAXBContext jc = JaxbContextHandler.getEndpointContext(); JAXBElement<EndpointDataType> slEndpoint = (JAXBElement<EndpointDataType>) jc.createUnmarshaller().unmarshal(is); return slEndpoint.getValue(); } catch (JAXBException e) { if (LOG.isLoggable(Level.SEVERE)) { LOG.log(Level.SEVERE, "Failed to deserialize endpoint data", e); } EndpointDataType endpointData = ENDPOINT_OBJECT_FACTORY.createEndpointDataType(); endpointData.setLastTimeStarted(-1); endpointData.setLastTimeStopped(-1); return endpointData; } }
@SuppressWarnings("unchecked") public static EndpointDataType toEndPointData(byte[] content) { if (content == null) { throw new IllegalArgumentException("content must not be null."); } final InputStream is = new ByteArrayInputStream(content); try { JAXBContext jc = JaxbContextHandler.getEndpointContext(); JAXBElement<EndpointDataType> slEndpoint = (JAXBElement<EndpointDataType>) jc.createUnmarshaller().unmarshal(is); return slEndpoint.getValue(); } catch (JAXBException e) { if (LOG.isLoggable(Level.SEVERE)) { LOG.log(Level.SEVERE, "Failed to deserialize endpoint data", e); } EndpointDataType endpointData = ENDPOINT_OBJECT_FACTORY.createEndpointDataType(); endpointData.setLastTimeStarted(-1); endpointData.setLastTimeStopped(-1); return endpointData; } }