org.jboss.wsf.spi.deployment.Endpoint.getState()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(4.9k)|赞(0)|评价(0)|浏览(132)

本文整理了Java中org.jboss.wsf.spi.deployment.Endpoint.getState()方法的一些代码示例,展示了Endpoint.getState()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Endpoint.getState()方法的具体详情如下:
包路径:org.jboss.wsf.spi.deployment.Endpoint
类名称:Endpoint
方法名:getState

Endpoint.getState介绍

[英]Get the current state for this endpoint
[中]获取此终结点的当前状态

代码示例

代码示例来源:origin: org.jboss.ws.native/jbossws-native-core

public Endpoint query(Iterator<Endpoint> endpoints)
  {
   Endpoint endpoint = null;

   if (contextPath.startsWith("/"))
     contextPath = contextPath.substring(1);

   while(endpoints.hasNext())
   {
     Endpoint auxEndpoint = endpoints.next();
     if (EndpointState.STARTED.equals(auxEndpoint.getState()))
     {
      ObjectName sepId = auxEndpoint.getName();
      String propContext = sepId.getKeyProperty(Endpoint.SEPID_PROPERTY_CONTEXT);
      String propEndpoint = sepId.getKeyProperty(Endpoint.SEPID_PROPERTY_ENDPOINT);
      if (servletName.equals(propEndpoint) && contextPath.equals(propContext))
      {
        endpoint = auxEndpoint;
        break;
      }
     }
   }

   return endpoint;
  }
}

代码示例来源:origin: org.jboss.ws/jbossws-framework

public void stop(Endpoint ep)
{
 if (log.isTraceEnabled())
   log.trace("Stop: " + ep.getName());
 EndpointState state = ep.getState();
 if (state != EndpointState.STARTED)
 {
   log.error("Cannot stop endpoint in state: " + state);
 }
 else
 {
   if (ep.getEndpointMetrics() != null)
    ep.getEndpointMetrics().stop();
   ep.setState(EndpointState.STOPPED);
 }
}

代码示例来源:origin: org.jboss.ws.native/jbossws-native-core

public Endpoint query(Iterator<Endpoint> endpoints)
{
 Endpoint endpoint = null;
 String pcName = this.pcLink;
 int hashIndex = this.pcLink.indexOf("#");
 if (hashIndex > 0)
 {
   pcName = pcLink.substring(hashIndex + 1);
 }
 while(endpoints.hasNext())
 {
   Endpoint auxEndpoint = endpoints.next();
   if (EndpointState.STARTED.equals(auxEndpoint.getState()))
   {
    ServerEndpointMetaData sepMetaData = auxEndpoint.getAttachment(ServerEndpointMetaData.class);
    if (pcName.equals(sepMetaData.getPortComponentName()))
    {
      if (endpoint != null)
      {
       NativeLoggers.ROOT_LOGGER.multipleServiceEndpointFoundFor(pcLink);
       endpoint = null;
       break;
      }
      endpoint = auxEndpoint;
    }
   }
 }
 return endpoint;
}

代码示例来源:origin: org.jboss.ws/jbossws-framework

public void start(Endpoint ep)
{
 if (log.isTraceEnabled())
   log.trace("Start: " + ep.getName());
 EndpointState state = ep.getState();
 if (state != EndpointState.UNDEFINED)
 {
   log.error("Cannot start endpoint in state: " + state);
 }
 else
 {
   if (ep.getEndpointMetrics() != null)
    ep.getEndpointMetrics().start();
   InvocationHandler invHandler = ep.getInvocationHandler();
   if (invHandler == null)
    throw new IllegalStateException("Invocation handler not available");
   invHandler.init(ep);
   ep.setState(EndpointState.STARTED);
 }
}

代码示例来源:origin: org.jboss.ws/jbossws-common

public void stop(Endpoint ep)
{
 EndpointState state = ep.getState();
 if (state == EndpointState.STOPPED) {
   //if the endpoint is stopped in EndpointServiceDA
   return;
 }
 if (state != EndpointState.STARTED)
 {
   Loggers.DEPLOYMENT_LOGGER.cannotStopEndpoint(state, ep.getName());
 }
 else
 {
   if (ep.getEndpointMetrics() != null)
    ep.getEndpointMetrics().stop();
   ep.setState(EndpointState.STOPPED);
 }
}

代码示例来源:origin: org.jboss.eap/wildfly-webservices-server-integration

/**
* Invokes WS endpoint.
*
* @param endpoint WS endpoint
* @param wsInvocation web service invocation
* @throws Exception if any error occurs
*/
public void invoke(final Endpoint endpoint, final Invocation wsInvocation) throws Exception {
  try {
    if (!EndpointState.STARTED.equals(endpoint.getState())) {
      throw WSLogger.ROOT_LOGGER.endpointAlreadyStopped(endpoint.getShortName());
    }
    SecurityDomainContext securityDomainContext = endpoint.getSecurityDomainContext();
    securityDomainContext.runAs((Callable<Void>) () -> {
      invokeInternal(endpoint, wsInvocation);
      return null;
    });
  } catch (Throwable t) {
    handleInvocationException(t);
  } finally {
    onAfterInvocation(wsInvocation);
  }
}

代码示例来源:origin: org.wildfly/wildfly-webservices-server-integration

/**
* Invokes WS endpoint.
*
* @param endpoint WS endpoint
* @param wsInvocation web service invocation
* @throws Exception if any error occurs
*/
public void invoke(final Endpoint endpoint, final Invocation wsInvocation) throws Exception {
  try {
    if (!EndpointState.STARTED.equals(endpoint.getState())) {
      throw WSLogger.ROOT_LOGGER.endpointAlreadyStopped(endpoint.getShortName());
    }
    SecurityDomainContext securityDomainContext = endpoint.getSecurityDomainContext();
    securityDomainContext.runAs((Callable<Void>) () -> {
      invokeInternal(endpoint, wsInvocation);
      return null;
    });
  } catch (Throwable t) {
    handleInvocationException(t);
  } finally {
    onAfterInvocation(wsInvocation);
  }
}

代码示例来源:origin: org.jboss.ws/jbossws-common

public void start(Endpoint ep)
{
 EndpointState state = ep.getState();
 if (state != EndpointState.UNDEFINED)
 {
   Loggers.DEPLOYMENT_LOGGER.cannotStartEndpoint(state, ep.getName());
 }
 else
 {
   if (ep.getEndpointMetrics() != null)
    ep.getEndpointMetrics().start();
   InvocationHandler invHandler = ep.getInvocationHandler();
   if (invHandler == null)
    throw Messages.MESSAGES.invocationHandlerNotAvailable(ep.getName());
   invHandler.init(ep);
   ep.setState(EndpointState.STARTED);
 }
}

代码示例来源:origin: org.jboss.ws.native/jbossws-native-core

try
  EndpointState state = ep.getState();
  if (state != EndpointState.STARTED)

相关文章