private void initWsClient ( BundleContext context ) throws Exception { ServiceReference serviceRef = context . getServiceReference ( ConfigurationAdmin . class . getName ( ) ) ; ConfigurationAdmin cfgAdmin = ( ConfigurationAdmin ) context . getService ( serviceRef ) ; Configuration config = cfgAdmin . getConfiguration ( "org.talend.esb.sam.agent" ) ; String serviceURL = ( String ) config . getProperties ( ) . get ( "service.url" ) ; retryNum = Integer . parseInt ( ( String ) config . getProperties ( ) . get ( "service.retry.number" ) ) ; retryDelay = Long . parseLong ( ( String ) config . getProperties ( ) . get ( "service.retry.delay" ) ) ; JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean ( ) ; factory . setServiceClass ( org . talend . esb . sam . monitoringservice . v1 . MonitoringService . class ) ; factory . setAddress ( serviceURL ) ; monitoringService = ( MonitoringService ) factory . create ( ) ; }
Inits the ws client .