public WebClient createWebClient ( ) { String serviceAddress = getAddress ( ) ; int queryIndex = serviceAddress != null ? serviceAddress . lastIndexOf ( ' ' ) : - 1 ; if ( queryIndex != - 1 ) { serviceAddress = serviceAddress . substring ( 0 , queryIndex ) ; } Service service = new JAXRSServiceImpl ( serviceAddress , getServiceName ( ) ) ; getServiceFactory ( ) . setService ( service ) ; try { Endpoint ep = createEndpoint ( ) ; this . getServiceFactory ( ) . sendEvent ( FactoryBeanListener . Event . PRE_CLIENT_CREATE , ep ) ; ClientState actualState = getActualState ( ) ; WebClient client = actualState == null ? new WebClient ( getAddress ( ) ) : new WebClient ( actualState ) ; initClient ( client , ep , actualState == null ) ; notifyLifecycleManager ( client ) ; this . getServiceFactory ( ) . sendEvent ( FactoryBeanListener . Event . CLIENT_CREATED , client , ep ) ; return client ; } catch ( Exception ex ) { LOG . severe ( ex . getClass ( ) . getName ( ) + " : " + ex . getLocalizedMessage ( ) ) ; throw new RuntimeException ( ex ) ; } }
Creates a WebClient instance