Refine search
private static class SingletonObjectFactoryHolder{ private static final ObjectFactory INSTANCE; static { try { INSTANCE = new ObjectFactory(); } catch (Exception e) { throw new ExceptionInInitializerError(e); } } }
ObjectFactory factory = new ObjectFactory(); JAXBElement<String> createMessageDescription = factory.createMessageDescription("description"); message.setDescription(createMessageDescription);
ObjectFactory factory = new ObjectFactory(); XhtmlHtmlType html = factory.createXhtmlHtmlType(); XhtmlHeadType head = factory.createXhtmlHeadType(); html.setHead(head); XhtmlStyleType style = factory.createXhtmlStyleType(); head.getContent().add(factory.createXhtmlHeadTypeStyle(style));
ObjectFactory objectFactory = new ObjectFactory(); JAXBElement<String> jaxbElement = objectFactory.createAmount("Hello World");
: ContextUtils.getNoneEndpointReference(); if (conduit != null && !StringUtils.isEmpty(s) && !reference.getAddress().getValue().equals(s)) { EndpointReferenceType ref = new EndpointReferenceType(); AttributedURIType tp = new AttributedURIType(); tp.setValue(s); ref.setAddress(tp); ref.setMetadata(reference.getMetadata()); ref.setReferenceParameters(reference.getReferenceParameters()); : Names.WSA_ANONYMOUS_ADDRESS); replyTo = ContextUtils.WSA_OBJECT_FACTORY.createEndpointReferenceType(); replyTo.setAddress(address);
/** * Convert from 2004/03 EndpointReferenceType to 2005/08 EndpointReferenceType. * * @param exposed the 2004/03 EndpointReferenceType * @return an equivalent 2005/08 EndpointReferenceType */ public static EndpointReferenceType convert(org.apache.cxf.ws.addressing.v200403.EndpointReferenceType exposed) { EndpointReferenceType internal = ContextUtils.WSA_OBJECT_FACTORY.createEndpointReferenceType(); internal.setAddress(convert(exposed.getAddress())); // TODO ref parameters not present in 2004/03 // internal.setReferenceParameters(convert(exposed // .getReferenceParameters())); org.apache.cxf.ws.addressing.v200403.ServiceNameType serviceName = exposed.getServiceName(); org.apache.cxf.ws.addressing.v200403.AttributedQName portName = exposed.getPortType(); if (serviceName != null && portName != null) { EndpointReferenceUtils.setServiceAndPortName(internal, serviceName.getValue(), portName .getValue().getLocalPart()); } // no direct analogue for ReferenceProperties addAll(internal.getAny(), exposed.getAny()); putAll(internal.getOtherAttributes(), exposed.getOtherAttributes()); return internal; }
/** * Create a duplicate endpoint reference sharing all atributes * @param ref the reference to duplicate * @return EndpointReferenceType - the duplicate endpoint reference */ public static EndpointReferenceType duplicate(EndpointReferenceType ref) { EndpointReferenceType reference = WSA_OBJECT_FACTORY.createEndpointReferenceType(); reference.setMetadata(ref.getMetadata()); reference.getAny().addAll(ref.getAny()); reference.setAddress(ref.getAddress()); return reference; }
/** * Convert from 2004/03 AttributedURI to 2005/08 AttributedURI. * * @param exposed the 2004/03 AttributedURI * @return an equivalent 2005/08 AttributedURIType */ public static AttributedURIType convert(org.apache.cxf.ws.addressing.v200403.AttributedURI exposed) { AttributedURIType internal = ContextUtils.WSA_OBJECT_FACTORY.createAttributedURIType(); String internalValue = Names200403.WSA_ANONYMOUS_ADDRESS.equals(exposed.getValue()) ? Names.WSA_ANONYMOUS_ADDRESS : Names200403.WSA_NONE_ADDRESS.equals(exposed.getValue()) ? Names.WSA_NONE_ADDRESS : exposed.getValue(); internal.setValue(internalValue); putAll(internal.getOtherAttributes(), exposed.getOtherAttributes()); return internal; }
/** * Set the address of the provided endpoint reference. * @param ref - the endpoint reference * @param address - the address */ public static void setAddress(EndpointReferenceType ref, String address) { AttributedURIType a = WSA_OBJECT_FACTORY.createAttributedURIType(); a.setValue(address); ref.setAddress(a); }
AddressingProperties inMaps = RMContextUtils.retrieveMAPs(message, false, false); inMaps.exposeAs(config.getAddressingNamespace()); acksTo = RMUtils.createReference(inMaps.getTo().getValue()); to = inMaps.getReplyTo(); source.getReliableEndpoint().getServant().setUnattachedIdentifier(inSeqId); relatesTo = (new org.apache.cxf.ws.addressing.ObjectFactory()).createRelatesToType(); Destination destination = getDestination(message); DestinationSequence inSeq = inSeqId == null ? null : destination.getSequence(inSeqId); to = RMUtils.createReference(maps.getTo().getValue()); acksTo = maps.getReplyTo(); if (RMUtils.getAddressingConstants().getNoneURI().equals(acksTo.getAddress().getValue())) { Endpoint ei = message.getExchange().getEndpoint(); org.apache.cxf.transport.Destination dest org.apache.cxf.common.i18n.Message msg = new org.apache.cxf.common.i18n.Message( "CREATE_SEQ_ANON_TARGET", LOG, to != null && to.getAddress() != null ? to.getAddress().getValue() : null); LOG.log(Level.INFO, msg.toString()); throw new RMException(msg);
public static EndpointReferenceType getEndpointReference(AttributedURIType address) { EndpointReferenceType reference = WSA_OBJECT_FACTORY.createEndpointReferenceType(); reference.setAddress(address); return reference; }
/** * Helper method to get an attributed URI. * * @param uri the URI * @return an AttributedURIType encapsulating the URI */ public static AttributedURIType getAttributedURI(String uri) { AttributedURIType attributedURI = WSA_OBJECT_FACTORY.createAttributedURIType(); attributedURI.setValue(uri); return attributedURI; }
public static org.apache.cxf.ws.addressing.EndpointReferenceType createReference(String address) { org.apache.cxf.ws.addressing.ObjectFactory factory = new org.apache.cxf.ws.addressing.ObjectFactory(); org.apache.cxf.ws.addressing.EndpointReferenceType epr = factory.createEndpointReferenceType(); org.apache.cxf.ws.addressing.AttributedURIType uri = factory.createAttributedURIType(); uri.setValue(address); epr.setAddress(uri); return epr; }
/** * Builds an new endpoint reference using the current target reference as a template. * The supplied id is endcoded using a reference parameter. * This requires the ws-a interceptors to propagate the reference parameters * on subsequent invokes using the returned reference. * @param id the id to encode in the new reference * @return the new reference with the id encoded as a reference parameter * @see org.apache.cxf.transport.MultiplexDestination#getAddressWithId(java.lang.String) */ public EndpointReferenceType getAddressWithId(String id) { EndpointReferenceType epr = EndpointReferenceUtils.duplicate( EndpointReferenceUtils.mint(reference, bus)); ReferenceParametersType newParams = new org.apache.cxf.ws.addressing.ObjectFactory() .createReferenceParametersType(); ReferenceParametersType existingParams = epr.getReferenceParameters(); if (null != existingParams) { newParams.getAny().addAll(existingParams.getAny()); } newParams.getAny().add(new JAXBElement<String>(MULTIPLEX_ID_QNAME, String.class, id)); epr.setReferenceParameters(newParams); return epr; }
public static void applyReferenceParam(EndpointReferenceType toEpr, Object el) { if (null == toEpr.getReferenceParameters()) { toEpr.setReferenceParameters(WSA_OBJECT_FACTORY.createReferenceParametersType()); } toEpr.getReferenceParameters().getAny().add(el); }
if (Names.WSA_MESSAGEID_NAME.equals(ent.getKey())) { AttributedURIType aAttributedURIType = WSA_OBJECT_FACTORY .createAttributedURIType(); aAttributedURIType.setValue(wsaHeaderValue); maps.setMessageID(aAttributedURIType); } else if (Names.WSA_TO_NAME.equals(ent.getKey())) { } else if (Names.WSA_RELATESTO_NAME.equals(ent.getKey())) { RelatesToType aRelatesToType = WSA_OBJECT_FACTORY .createRelatesToType(); aRelatesToType.setValue(wsaHeaderValue); maps.setRelatesTo(aRelatesToType); } else if (Names.WSA_ACTION_NAME.equals(ent.getKey())) { AttributedURIType aAttributedURIType = WSA_OBJECT_FACTORY .createAttributedURIType(); aAttributedURIType.setValue(wsaHeaderValue); maps.setAction(aAttributedURIType);
public static MetadataType getSetMetadata(EndpointReferenceType ref) { MetadataType mt = ref.getMetadata(); if (null == mt) { mt = WSA_OBJECT_FACTORY.createMetadataType(); ref.setMetadata(mt); } return mt; }
public static EndpointReferenceType createEndpointReferenceWithMetadata() { EndpointReferenceType reference = WSA_OBJECT_FACTORY.createEndpointReferenceType(); reference.setMetadata(WSA_OBJECT_FACTORY.createMetadataType()); return reference; }
/** * Helper method to get a RealtesTo instance. * * @param uri the related URI * @return a RelatesToType encapsulating the URI */ public static RelatesToType getRelatesTo(String uri) { RelatesToType relatesTo = WSA_OBJECT_FACTORY.createRelatesToType(); relatesTo.setValue(uri); return relatesTo; }
/** * Create an anonymous endpoint reference. * @return EndpointReferenceType - the endpoint reference */ public static EndpointReferenceType getAnonymousEndpointReference() { EndpointReferenceType reference = WSA_OBJECT_FACTORY.createEndpointReferenceType(); setAddress(reference, ANONYMOUS_ADDRESS); return reference; }