public static Map<String, List<String>> getTransportHeaders(Packet packet, boolean inbound) { Map<String, List<String>> headers = null; String key = inbound ? Packet.INBOUND_TRANSPORT_HEADERS : Packet.OUTBOUND_TRANSPORT_HEADERS; if (packet.supports(key)) { headers = (Map<String, List<String>>)packet.get(key); } return headers; }
public Object get(Object key) { if(packet.supports(key)) return packet.get(key); // strongly typed if(packet.getHandlerScopePropertyNames(true).contains(key)) return null; // no such application-scope property Object value = packet.invocationProperties.get(key); //add the attachments from the Message to the corresponding attachment property if(key.equals(MessageContext.INBOUND_MESSAGE_ATTACHMENTS)){ Map<String, DataHandler> atts = (Map<String, DataHandler>) value; if(atts == null) atts = new HashMap<String, DataHandler>(); AttachmentSet attSet = packet.getMessage().getAttachments(); for(Attachment att : attSet){ atts.put(att.getContentId(), att.asDataHandler()); } return atts; } return value; }
public Object get(Object key) { if(packet.supports(key)) return packet.get(key); // strongly typed if(packet.getHandlerScopePropertyNames(true).contains(key)) return null; // no such application-scope property Object value = packet.invocationProperties.get(key); //add the attachments from the Message to the corresponding attachment property if(key.equals(MessageContext.INBOUND_MESSAGE_ATTACHMENTS)){ Map<String, DataHandler> atts = (Map<String, DataHandler>) value; if(atts == null) atts = new HashMap<String, DataHandler>(); AttachmentSet attSet = packet.getMessage().getAttachments(); for(Attachment att : attSet){ atts.put(att.getContentId(), att.asDataHandler()); } return atts; } return value; }
public static Map<String, List<String>> getTransportHeaders(Packet packet, boolean inbound) { Map<String, List<String>> headers = null; String key = inbound ? Packet.INBOUND_TRANSPORT_HEADERS : Packet.OUTBOUND_TRANSPORT_HEADERS; if (packet.supports(key)) { headers = (Map<String, List<String>>)packet.get(key); } return headers; }
public Object get(Object key) { if(packet.supports(key)) return packet.get(key); // strongly typed if(packet.getHandlerScopePropertyNames(true).contains(key)) return null; // no such application-scope property Object value = packet.invocationProperties.get(key); //add the attachments from the Message to the corresponding attachment property if(key.equals(MessageContext.INBOUND_MESSAGE_ATTACHMENTS)){ Map<String, DataHandler> atts = (Map<String, DataHandler>) value; if(atts == null) atts = new HashMap<String, DataHandler>(); AttachmentSet attSet = packet.getMessage().getAttachments(); for(Attachment att : attSet){ atts.put(att.getContentId(), att.asDataHandler()); } return atts; } return value; }
public static Map<String, List<String>> getTransportHeaders(Packet packet, boolean inbound) { Map<String, List<String>> headers = null; String key = inbound ? Packet.INBOUND_TRANSPORT_HEADERS : Packet.OUTBOUND_TRANSPORT_HEADERS; if (packet.supports(key)) { headers = (Map<String, List<String>>)packet.get(key); } return headers; }
@Override @SuppressWarnings("element-type-mismatch") public Object get(Object key) { if (packet.supports(key)) { return packet.get(key); // strongly typed } if (packet.getHandlerScopePropertyNames(true).contains(key)) { return null; // no such application-scope property } Object value = packet.invocationProperties.get(key); //add the attachments from the Message to the corresponding attachment property if(key.equals(MessageContext.OUTBOUND_MESSAGE_ATTACHMENTS) || key.equals(MessageContext.INBOUND_MESSAGE_ATTACHMENTS)){ Map<String, DataHandler> atts = (Map<String, DataHandler>) value; if(atts == null) atts = new HashMap<String, DataHandler>(); AttachmentSet attSet = packet.getMessage().getAttachments(); for(Attachment att : attSet){ atts.put(att.getContentId(), att.asDataHandler()); } return atts; } return value; }
public Object get(Object obj) { if(packet.supports(obj)) { return packet.get(obj); } return packet.invocationProperties.get(obj); }
@Override @SuppressWarnings("element-type-mismatch") public Object get(Object key) { if (packet.supports(key)) { return packet.get(key); // strongly typed } if (packet.getHandlerScopePropertyNames(true).contains(key)) { return null; // no such application-scope property } Object value = packet.invocationProperties.get(key); //add the attachments from the Message to the corresponding attachment property if(key.equals(MessageContext.OUTBOUND_MESSAGE_ATTACHMENTS) || key.equals(MessageContext.INBOUND_MESSAGE_ATTACHMENTS)){ Map<String, DataHandler> atts = (Map<String, DataHandler>) value; if(atts == null) atts = new HashMap<String, DataHandler>(); AttachmentSet attSet = packet.getMessage().getAttachments(); for(Attachment att : attSet){ atts.put(att.getContentId(), att.asDataHandler()); } return atts; } return value; }
public @NotNull T resolve(Packet request) { HttpServletRequest sr = (HttpServletRequest) request.get(MessageContext.SERVLET_REQUEST); if(sr==null) throw new WebServiceException( clazz+" has @"+ HttpSessionScope.class.getSimpleName()+" but it's deployed on non-servlet endpoint"); HttpSession session = sr.getSession(); T o = clazz.cast(session.getAttribute(clazz.getName())); if(o==null) { o = create(); session.setAttribute(clazz.getName(),o); } return o; } }
@Override @SuppressWarnings("element-type-mismatch") public Object get(Object key) { if (packet.supports(key)) { return packet.get(key); // strongly typed } if (packet.getHandlerScopePropertyNames(true).contains(key)) { return null; // no such application-scope property } Object value = packet.invocationProperties.get(key); //add the attachments from the Message to the corresponding attachment property if(key.equals(MessageContext.OUTBOUND_MESSAGE_ATTACHMENTS) || key.equals(MessageContext.INBOUND_MESSAGE_ATTACHMENTS)){ Map<String, DataHandler> atts = (Map<String, DataHandler>) value; if(atts == null) atts = new HashMap<String, DataHandler>(); AttachmentSet attSet = packet.getMessage().getAttachments(); for(Attachment att : attSet){ atts.put(att.getContentId(), att.asDataHandler()); } return atts; } return value; }
public @NotNull T resolve(Packet request) { HttpServletRequest sr = (HttpServletRequest) request.get(MessageContext.SERVLET_REQUEST); if(sr==null) throw new WebServiceException( clazz+" has @"+ HttpSessionScope.class.getSimpleName()+" but it's deployed on non-servlet endpoint"); HttpSession session = sr.getSession(); T o = clazz.cast(session.getAttribute(clazz.getName())); if(o==null) { o = create(); session.setAttribute(clazz.getName(),o); } return o; } }
public @NotNull T resolve(Packet request) { HttpServletRequest sr = (HttpServletRequest) request.get(MessageContext.SERVLET_REQUEST); if(sr==null) throw new WebServiceException( clazz+" has @"+ HttpSessionScope.class.getSimpleName()+" but it's deployed on non-servlet endpoint"); HttpSession session = sr.getSession(); T o = clazz.cast(session.getAttribute(clazz.getName())); if(o==null) { o = create(); session.setAttribute(clazz.getName(),o); } return o; } }
@Override public T resolve(Packet request) { T endpoint = create(); ServletContext servletContext = (ServletContext) request .get(MessageContext.SERVLET_CONTEXT); TrustService trustService = ServiceConsumerServletContextListener .getTrustService(servletContext); injectServices(endpoint, trustService); return endpoint; }
public static State initFrom(final Packet packet) { final State oldState = state.get(); HaInfo haInfo = null; if (packet != null && packet.supports(Packet.HA_INFO)) { haInfo = (HaInfo) packet.get(Packet.HA_INFO); } final State newState = new State(packet, haInfo); state.set(newState); if (LOGGER.isLoggable(Level.FINER)) { LOGGER.finer("[METRO-HA] " + Thread.currentThread().toString() + " : Initialized from packet - replaced old " + oldState.toString() + " with a new " + newState.toString()); } return oldState; }
private void addReplicaCookie(WSHTTPConnection con, Packet packet) { if (stickyCookie) { HaInfo haInfo = null; if (packet.supports(Packet.HA_INFO)) { haInfo = (HaInfo)packet.get(Packet.HA_INFO); } if (haInfo != null) { con.setCookie("METRO_KEY", haInfo.getKey()); if (!disableJreplicaCookie) { con.setCookie("JREPLICA", haInfo.getReplicaInstance()); } } } }
private void addReplicaCookie(WSHTTPConnection con, Packet packet) { if (stickyCookie) { HaInfo haInfo = null; if (packet.supports(Packet.HA_INFO)) { haInfo = (HaInfo)packet.get(Packet.HA_INFO); } if (haInfo != null) { con.setCookie("METRO_KEY", haInfo.getKey()); if (!disableJreplicaCookie) { con.setCookie("JREPLICA", haInfo.getReplicaInstance()); } } } }
private void addReplicaCookie(WSHTTPConnection con, Packet packet) { if (stickyCookie) { HaInfo haInfo = null; if (packet.supports(Packet.HA_INFO)) { haInfo = (HaInfo)packet.get(Packet.HA_INFO); } if (haInfo != null) { con.setCookie("METRO_KEY", haInfo.getKey()); if (!disableJreplicaCookie) { con.setCookie("JREPLICA", haInfo.getReplicaInstance()); } } } }