--- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/transport/http/server/EndpointImpl.java Fri Feb 10 00:39:51 2017 -0800
+++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/transport/http/server/EndpointImpl.java Thu Feb 16 13:14:39 2017 +0300
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -69,13 +69,11 @@
/**
* Implements {@link Endpoint}.
- * <p/>
- * <p/>
+ *
* This class accumulates the information necessary to create
* {@link WSEndpoint}, and then when {@link #publish} method
* is called it will be created.
- * <p/>
- * <p/>
+ *
* This object also allows accumulated information to be retrieved.
*
* @author Jitendra Kotamraju
@@ -205,14 +203,17 @@
invoker = null;
}
+ @Override
public Binding getBinding() {
return binding;
}
+ @Override
public Object getImplementor() {
return implementor;
}
+ @Override
public void publish(String address) {
canPublish();
URL url;
@@ -232,6 +233,7 @@
((HttpEndpoint) actualEndpoint).publish(address);
}
+ @Override
public void publish(Object serverContext) {
canPublish();
if (!com.sun.net.httpserver.HttpContext.class.isAssignableFrom(serverContext.getClass())) {
@@ -241,12 +243,14 @@
((HttpEndpoint) actualEndpoint).publish(serverContext);
}
+ @Override
public void publish(HttpContext serverContext) {
canPublish();
createEndpoint(serverContext.getPath());
((HttpEndpoint) actualEndpoint).publish(serverContext);
}
+ @Override
public void stop() {
if (isPublished()) {
((HttpEndpoint) actualEndpoint).stop();
@@ -255,14 +259,17 @@
}
}
+ @Override
public boolean isPublished() {
return actualEndpoint != null;
}
+ @Override
public List<Source> getMetadata() {
return metadata;
}
+ @Override
public void setMetadata(java.util.List<Source> metadata) {
if (isPublished()) {
throw new IllegalStateException("Cannot set Metadata. Endpoint is already published");
@@ -270,20 +277,24 @@
this.metadata = metadata;
}
+ @Override
public Executor getExecutor() {
return executor;
}
+ @Override
public void setExecutor(Executor executor) {
this.executor = executor;
}
+ @Override
public Map<String, Object> getProperties() {
- return new HashMap<String, Object>(properties);
+ return new HashMap<>(properties);
}
+ @Override
public void setProperties(Map<String, Object> map) {
- this.properties = new HashMap<String, Object>(map);
+ this.properties = new HashMap<>(map);
}
/*
@@ -335,7 +346,7 @@
* reuse the Source object multiple times.
*/
private List<SDDocumentSource> buildDocList() {
- List<SDDocumentSource> r = new ArrayList<SDDocumentSource>();
+ List<SDDocumentSource> r = new ArrayList<>();
if (metadata != null) {
for (Source source : metadata) {
@@ -344,14 +355,8 @@
String systemId = source.getSystemId();
r.add(SDDocumentSource.create(new URL(systemId), xsbr.getXMLStreamBuffer()));
- } catch (TransformerException te) {
- throw new ServerRtException("server.rt.err", te);
- } catch (IOException te) {
+ } catch (TransformerException | IOException | SAXException | ParserConfigurationException te) {
throw new ServerRtException("server.rt.err", te);
- } catch (SAXException e) {
- throw new ServerRtException("server.rt.err", e);
- } catch (ParserConfigurationException e) {
- throw new ServerRtException("server.rt.err", e);
}
}
}
@@ -367,11 +372,6 @@
EndpointFactory.verifyImplementorClass(implClass, metadataReader);
String wsdlLocation = EndpointFactory.getWsdlLocation(implClass, metadataReader);
if (wsdlLocation != null) {
- ClassLoader cl = implClass.getClassLoader();
- URL url = cl.getResource(wsdlLocation);
- if (url != null) {
- return SDDocumentSource.create(url);
- }
return SDDocumentSource.create(implClass, wsdlLocation);
}
return null;
@@ -388,10 +388,12 @@
}
}
+ @Override
public EndpointReference getEndpointReference(Element...referenceParameters) {
return getEndpointReference(W3CEndpointReference.class, referenceParameters);
}
+ @Override
public <T extends EndpointReference> T getEndpointReference(Class<T> clazz, Element...referenceParameters) {
if (!isPublished()) {
throw new WebServiceException("Endpoint is not published yet");
@@ -458,13 +460,12 @@
public void start(@NotNull WSWebServiceContext wsc, @NotNull WSEndpoint endpoint) {
try {
spiInvoker.inject(wsc);
- } catch (IllegalAccessException e) {
- throw new WebServiceException(e);
- } catch (InvocationTargetException e) {
+ } catch (IllegalAccessException | InvocationTargetException e) {
throw new WebServiceException(e);
}
}
+ @Override
public Object invoke(@NotNull Packet p, @NotNull Method m, @NotNull Object... args) throws InvocationTargetException, IllegalAccessException {
return spiInvoker.invoke(m, args);
}