public static void setAddress(AbstractDestination dest, String absAddress) { dest.getEndpointInfo().setAddress(absAddress); if (dest.getEndpointInfo().getExtensor(AddressType.class) != null) { dest.getEndpointInfo().getExtensor(AddressType.class).setLocation(absAddress); } } }
@Override public void handle(HttpExchange exchange) throws IOException { try { //Update address in EndpointInfo; this can only happen here, //as the contextPath is provided in the HttpExchange only EndpointInfo ei = destination.getEndpointInfo(); if (ei != null) { String ad = ei.getAddress(); String path = exchange.getHttpContext().getPath(); if (ad != null && ad.equals(path)) { synchronized (ei) { String contextPath = exchange.getContextPath(); ei.setAddress(contextPath + path); if (ei.getExtensor(AddressType.class) != null) { ei.getExtensor(AddressType.class).setLocation(contextPath + path); } else if (ei.getExtensor(SoapAddress.class) != null) { ei.getExtensor(SoapAddress.class).setLocationURI(contextPath + path); } } } } //service request destination.doService(new HttpServletRequestAdapter(exchange), new HttpServletResponseAdapter(exchange)); } finally { exchange.close(); } }
public Policy getEffectivePolicy(EndpointInfo ei, Message m) { return ei.getExtensor(Policy.class); }
public Policy getEffectivePolicy(EndpointInfo ei, Message m) { return ei.getExtensor(Policy.class); }
@Override public <T> T getTraversedExtensor(T defaultValue, Class<T> type) { T value = getExtensor(type); if (value == null) { if (binding != null) { value = binding.getExtensor(type); } if (service != null && value == null) { value = service.getExtensor(type); } if (value == null) { value = defaultValue; } } return value; }
public static void setAddress(AbstractDestination dest, String absAddress) { dest.getEndpointInfo().setAddress(absAddress); if (dest.getEndpointInfo().getExtensor(AddressType.class) != null) { dest.getEndpointInfo().getExtensor(AddressType.class).setLocation(absAddress); } } }
@Override public <T> T getTraversedExtensor(T defaultValue, Class<T> type) { T value = getExtensor(type); if (value == null) { if (binding != null) { value = binding.getExtensor(type); } if (service != null && value == null) { value = service.getExtensor(type); } if (value == null) { value = defaultValue; } } return value; }
@Override public <T> T getTraversedExtensor(T defaultValue, Class<T> type) { T value = getExtensor(type); if (value == null) { if (binding != null) { value = binding.getExtensor(type); } if (service != null && value == null) { value = service.getExtensor(type); } if (value == null) { value = defaultValue; } } return value; }
@Override public <T> T getTraversedExtensor(T defaultValue, Class<T> type) { T value = getExtensor(type); if (value == null) { if (binding != null) { value = binding.getExtensor(type); } if (service != null && value == null) { value = service.getExtensor(type); } if (value == null) { value = defaultValue; } } return value; }
public static void setAddress(AbstractDestination dest, String absAddress) { dest.getEndpointInfo().setAddress(absAddress); if (WSDLLibrary.isAvailable() && dest.getEndpointInfo().getExtensor(AddressType.class) != null) { dest.getEndpointInfo().getExtensor(AddressType.class).setLocation(absAddress); } } }
public static <T> T getWSDLExtensor(EndpointInfo ei, Class<T> cls) { ServiceInfo si = ei.getService(); BindingInfo bi = ei.getBinding(); Object o = ei.getExtensor(cls); if (o == null && si != null) { o = si.getExtensor(cls); } if (o == null && bi != null) { o = bi.getExtensor(cls); } if (o == null) { return null; } if (cls.isInstance(o)) { return cls.cast(o); } return null; } }
@Override public void handle(HttpExchange exchange) throws IOException { try { //Update address in EndpointInfo; this can only happen here, //as the contextPath is provided in the HttpExchange only EndpointInfo ei = destination.getEndpointInfo(); if (ei != null) { String ad = ei.getAddress(); String path = exchange.getHttpContext().getPath(); if (ad != null && ad.equals(path)) { synchronized (ei) { String contextPath = exchange.getContextPath(); ei.setAddress(contextPath + path); if (ei.getExtensor(AddressType.class) != null) { ei.getExtensor(AddressType.class).setLocation(contextPath + path); } else if (ei.getExtensor(SoapAddress.class) != null) { ei.getExtensor(SoapAddress.class).setLocationURI(contextPath + path); } } } } //service request destination.doService(new HttpServletRequestAdapter(exchange), new HttpServletResponseAdapter(exchange)); } finally { exchange.close(); } }
protected Destination getDestination(EndpointInfo ei, EndpointReferenceType reference, Bus bus) throws IOException { Destination d = null; String addr = reference.getAddress().getValue(); if (addr == null) { AddressType tp = ei.getExtensor(AddressType.class); if (tp != null) { addr = tp.getLocation(); } } if (addr == null) { addr = NULL_ADDRESS; } d = destinations.get(addr); if (d == null) { d = createDestination(ei, reference, bus); Destination tmpD = destinations.putIfAbsent(addr, d); if (tmpD != null) { d = tmpD; } } return d; }
protected Destination getDestination(EndpointInfo ei, EndpointReferenceType reference, Bus bus) throws IOException { Destination d = null; String addr = reference.getAddress().getValue(); if (addr == null) { AddressType tp = ei.getExtensor(AddressType.class); if (tp != null) { addr = tp.getLocation(); } } if (addr == null) { addr = NULL_ADDRESS; } d = destinations.get(addr); if (d == null) { d = createDestination(ei, reference, bus); Destination tmpD = destinations.putIfAbsent(addr, d); if (tmpD != null) { d = tmpD; } } return d; }
if (ei.getExtensor(AddressType.class) != null) ei.getExtensor(AddressType.class).setLocation(serviceUri);
public CorbaDestination(EndpointInfo ei, OrbConfig config, CorbaTypeMap tm) { address = ei.getExtensor(AddressType.class); binding = ei.getBinding(); reference = new EndpointReferenceType(); AttributedURIType addr = new AttributedURIType(); addr.setValue(address.getLocation()); reference.setAddress(addr); endpointInfo = ei; orbConfig = config; if (tm != null) { typeMap = tm; } else { typeMap = TypeMapCache.get(binding.getService()); } PolicyType policy = ei.getExtensor(PolicyType.class); if (policy != null) { poaName = policy.getPoaname(); isPersistent = policy.isPersistent(); serviceId = policy.getServiceid(); } }
protected void processGET(Request request, Response response) throws Exception { if (request.getParameter("wsdl") != null || request.getParameter("WSDL") != null || request.getParameter("xsd") != null || request.getParameter("XSD") != null) { GeronimoQueryHandler queryHandler = new GeronimoQueryHandler(this.bus); URI requestURI = request.getURI(); EndpointInfo ei = this.destination.getEndpointInfo(); // update service port location on each request SoapAddress address = ei.getExtensor(SoapAddress.class); address.setLocationURI(getBaseUri(requestURI)); OutputStream out = response.getOutputStream(); String baseUri = requestURI.toString(); response.setContentType("text/xml"); queryHandler.writeResponse(baseUri, null, ei, out); } else if (endpoint.isSOAP11()) { EndpointInfo ei = this.destination.getEndpointInfo(); response.setContentType("text/html"); PrintWriter pw = new PrintWriter(response.getOutputStream()); pw.write("<html><title>Web Service</title><body>"); pw.write("Hi, this is '" + ei.getService().getName().getLocalPart() + "' web service."); pw.write("</body></html>"); pw.flush(); } else { processPOST(request, response); } }
AddressType ad = endpointInfo.getExtensor(AddressType.class); if (ad != null) { address = ad.getLocation();
@Override public void filter(ClientRequestContext requestContext) throws IOException { JwtToken jwt = getJwtToken(requestContext); if (jwt == null && super.isJweRequired()) { AuthorizationPolicy ap = JAXRSUtils.getCurrentMessage().getExchange() .getEndpoint().getEndpointInfo().getExtensor(AuthorizationPolicy.class); if (ap != null && ap.getUserName() != null) { JwtClaims claims = new JwtClaims(); claims.setSubject(ap.getUserName()); claims.setClaim("password", ap.getPassword()); claims.setIssuedAt(System.currentTimeMillis() / 1000L); jwt = new JwtToken(new JweHeaders(), claims); } } if (jwt == null) { throw new JoseException("JWT token is not available"); } String data = super.processJwt(jwt); requestContext.getHeaders().putSingle(HttpHeaders.AUTHORIZATION, authScheme + " " + data); }
JAXWSBinding bind = port.getExtensor(JAXWSBinding.class); if (bind != null) { jport.setMethodName(bind.getMethodName());