本文整理汇总了Java中javax.xml.ws.Endpoint.stop方法的典型用法代码示例。如果您正苦于以下问题:Java Endpoint.stop方法的具体用法?Java Endpoint.stop怎么用?Java Endpoint.stop使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.xml.ws.Endpoint
的用法示例。
在下文中一共展示了Endpoint.stop方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: dispose
import javax.xml.ws.Endpoint; //导入方法依赖的package包/类
@Override
public void dispose ()
{
super.dispose ();
List<Endpoint> endpoints;
synchronized ( this )
{
endpoints = new ArrayList<Endpoint> ( this.endpoints.values () );
this.endpoints.clear ();
}
for ( final Endpoint e : endpoints )
{
e.stop ();
}
}
示例2: unexportService
import javax.xml.ws.Endpoint; //导入方法依赖的package包/类
@Override
protected void unexportService ( final ServiceReference<?> serviceReference )
{
final Endpoint e;
synchronized ( this )
{
e = this.endpoints.remove ( serviceReference );
}
if ( e != null )
{
if ( e.isPublished () )
{
try
{
e.stop ();
}
catch ( final Exception ex )
{
logger.warn ( "Failed to stop export", ex );
}
}
}
}
示例3: testMultiplePublishSameAddress
import javax.xml.ws.Endpoint; //导入方法依赖的package包/类
@Test
public void testMultiplePublishSameAddress() throws Exception
{
server.start();
String contextPath = "/ctxt";
String path = "/echo";
for (int i = 0; i < 3; i++)
{
HttpContext ctx = UndertowContextFactory.createHttpContext(server, contextPath, path);
String address = "http://localhost:" + currentPort + contextPath + path;
Endpoint endpoint = Endpoint.create(new EndpointBean());
endpoint.publish(ctx); // Use httpserver context for publishing
invokeEndpoint(address);
endpoint.stop();
}
}
示例4: test
import javax.xml.ws.Endpoint; //导入方法依赖的package包/类
@Test
@RunAsClient
public void test() throws Exception
{
String publishURL1 = "http://" + getServerHost() + ":" + port + "/jaxws-endpoint1";
Endpoint endpoint1 = publishEndpoint(new EndpointBean(), publishURL1);
String publishURL2 = "http://" + getServerHost() + ":" + port + "/jaxws-endpoint2";
Endpoint endpoint2 = publishEndpoint(new EndpointBean(), publishURL2);
invokeEndpoint(publishURL1);
invokeEndpoint(publishURL2);
endpoint1.stop();
endpoint2.stop();
}
示例5: echo
import javax.xml.ws.Endpoint; //导入方法依赖的package包/类
public String echo(String input, String serverHost, int port)
{
Endpoint ep = Endpoint.create(new EndpointBean());
String publishUrl = "http://" + serverHost + ":" + port + "/foo/bar";
ep.publish(publishUrl);
try
{
QName qname = new QName("http://org.jboss.ws/jaxws/endpoint", "EndpointService");
Service service = Service.create(new URL(publishUrl + "?wsdl"), qname);
EndpointInterface proxy = (EndpointInterface) service.getPort(EndpointInterface.class);
return proxy.echo(input);
}
catch (Exception e)
{
throw new WebServiceException(e);
}
finally
{
if (ep != null)
{
ep.stop();
}
}
}
示例6: testDifferentPortsSameContext
import javax.xml.ws.Endpoint; //导入方法依赖的package包/类
@Test
@RunAsClient
public void testDifferentPortsSameContext() throws Exception
{
String publishURL1 = "http://" + getServerHost() + ":" + port1 + "/jaxws-endpoint/";
Endpoint endpoint1 = publishEndpoint1(new Endpoint1Impl(), publishURL1);
String publishURL2 = "http://" + getServerHost() + ":" + port2 + "/jaxws-endpoint";
Endpoint endpoint2 = publishEndpoint2(new Endpoint1Impl(), publishURL2);
invokeEndpoint1(publishURL1);
invokeEndpoint1(publishURL2);
endpoint1.stop();
endpoint2.stop();
}
示例7: testDifferentPortsNoContext
import javax.xml.ws.Endpoint; //导入方法依赖的package包/类
@Test
@RunAsClient
public void testDifferentPortsNoContext() throws Exception
{
String publishURL1 = "http://" + getServerHost() + ":" + port1 + "/";
Endpoint endpoint1 = publishEndpoint1(new Endpoint1Impl(), publishURL1);
String publishURL2 = "http://" + getServerHost() + ":" + port2;
Endpoint endpoint2 = publishEndpoint2(new Endpoint1Impl(), publishURL2);
invokeEndpoint1(publishURL1);
if (isIntegrationCXF())
{
//sun.net.www.protocol.http.HttpURLConnection barfs on addresses like http://localhost:8872?wsdl
invokeEndpoint1(publishURL2.replace(String.valueOf(port2), port2 + "/"));
}
else
{
invokeEndpoint1(publishURL2);
}
endpoint1.stop();
endpoint2.stop();
}
示例8: testDifferentPortsAndLongPaths
import javax.xml.ws.Endpoint; //导入方法依赖的package包/类
@Test
@RunAsClient
public void testDifferentPortsAndLongPaths() throws Exception
{
String publishURL1 = "http://" + getServerHost() + ":" + port1 + "/jaxws-endpoint/endpoint/long/path/";
Endpoint endpoint1 = publishEndpoint3(new Endpoint1Impl(), publishURL1);
String publishURL2 = "http://" + getServerHost() + ":" + port2 + "/jaxws-endpoint/endpoint/long/path";
Endpoint endpoint2 = publishEndpoint1(new Endpoint1Impl(), publishURL2);
invokeEndpoint1(publishURL1);
invokeEndpoint1(publishURL2);
endpoint1.stop();
endpoint2.stop();
}
示例9: testSamePortsAndAlmostIdenticalLongPaths
import javax.xml.ws.Endpoint; //导入方法依赖的package包/类
@Test
@RunAsClient
public void testSamePortsAndAlmostIdenticalLongPaths() throws Exception
{
String publishURL1 = "http://" + getServerHost() + ":" + port1 + "/jaxws-endpoint/endpoint/number1/";
Endpoint endpoint1 = publishEndpoint2(new Endpoint1Impl(), publishURL1);
String publishURL2 = "http://" + getServerHost() + ":" + port1 + "/jaxws-endpoint/endpoint/number11";
Endpoint endpoint2 = publishEndpoint3(new Endpoint1Impl(), publishURL2);
invokeEndpoint2(publishURL1);
invokeEndpoint2(publishURL2);
endpoint1.stop();
endpoint2.stop();
}
示例10: testDifferentPortsAndIdenticalPaths
import javax.xml.ws.Endpoint; //导入方法依赖的package包/类
@Test
@RunAsClient
public void testDifferentPortsAndIdenticalPaths() throws Exception
{
String publishURL1 = "http://" + getServerHost() + ":" + port1 + "/jaxws-endpoint/endpoint/number1/";
Endpoint endpoint1 = publishEndpoint1(new Endpoint1Impl(), publishURL1);
String publishURL2 = "http://" + getServerHost() + ":" + port2 + "/jaxws-endpoint/endpoint/number1";
Endpoint endpoint2 = publishEndpoint2(new Endpoint1Impl(), publishURL2);
invokeEndpoint2(publishURL1);
invokeEndpoint2(publishURL2);
endpoint1.stop();
endpoint2.stop();
}
示例11: testMetadata
import javax.xml.ws.Endpoint; //导入方法依赖的package包/类
public void testMetadata() throws Exception {
SampleEndpoint sample = new SampleEndpoint();
Endpoint ep = Endpoint.create(sample);
assertTrue("The returned Endpoint instance was null", ep != null);
ep.publish("test");
assertTrue("The endpoint was not published successfully", ep.isPublished());
String wsdlLocation = "http://test.wsdl.com/Test.wsdl"; // Dummy URL
List<Source> metadata = new ArrayList<Source>();
Source source = new StreamSource(new ByteArrayInputStream(new byte[0])); // Dummy content
source.setSystemId(wsdlLocation);
metadata.add(source);
ep.setMetadata(metadata);
metadata = ep.getMetadata();
assertNotNull(metadata);
source = metadata.get(0);
assertNotNull(source);
assertEquals(source.getSystemId(), wsdlLocation);
ep.stop();
}
示例12: main
import javax.xml.ws.Endpoint; //导入方法依赖的package包/类
public static void main(String[] args) throws IOException {
final Endpoint endpoint = createEndpoint(WS_ADDRESS);
try {
final Service service = createWebService();
final DataAccess serviceDataAccess = service.getPort(DataAccess.class);
final byte[] data = serviceDataAccess.getQuicklookData(QL_URI_RGB1);
final BufferedImage image = ImageIO.read(new ByteArrayInputStream(data));
final JFrame frame = new JFrame();
frame.add(new JLabel(new ImageIcon(image)));
frame.pack();
frame.setVisible(true);
frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
} finally {
endpoint.stop();
}
}
示例13: doGet
import javax.xml.ws.Endpoint; //导入方法依赖的package包/类
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
final String param = req.getParameter("abc");
try{
String publishURL1 = "http://localhost:" + port + "/jaxws-endpoint1";
Endpoint endpoint1 = publishEndpoint(new EndpointBean(), publishURL1);
String publishURL2 = "http://localhost:" + port + "/jaxws-endpoint2";
Endpoint endpoint2 = publishEndpoint(new EndpointBean(), publishURL2);
invokeEndpoint(publishURL1, param);
invokeEndpoint(publishURL2, param);
endpoint1.stop();
endpoint2.stop();
} catch (Exception e){fail("Exception raised: "+ e.getMessage());}
}
示例14: destroy
import javax.xml.ws.Endpoint; //导入方法依赖的package包/类
/**
* Stops all published endpoints, taking the web services offline.
*/
@Override
public void destroy() {
for (Endpoint endpoint : this.publishedEndpoints) {
endpoint.stop();
}
}
示例15: stop
import javax.xml.ws.Endpoint; //导入方法依赖的package包/类
private static void stop(Endpoint endPoint) {
if (endPoint == null) return;
try {
endPoint.stop();
} catch (Throwable ignored) {
}
}