Tabnine Logo
XxlRpcProviderFactory
Code IndexAdd Tabnine to your IDE (free)

How to use
XxlRpcProviderFactory
in
com.xxl.rpc.remoting.provider

Best Java code snippets using com.xxl.rpc.remoting.provider.XxlRpcProviderFactory (Showing top 7 results out of 315)

origin: xuxueli/xxl-job

private void initRpcProvider(String ip, int port, String appName, String accessToken) throws Exception {
  // init, provider factory
  String address = IpUtil.getIpPort(ip, port);
  Map<String, String> serviceRegistryParam = new HashMap<String, String>();
  serviceRegistryParam.put("appName", appName);
  serviceRegistryParam.put("address", address);
  xxlRpcProviderFactory = new XxlRpcProviderFactory();
  xxlRpcProviderFactory.initConfig(NetEnum.JETTY, Serializer.SerializeEnum.HESSIAN.getSerializer(), ip, port, accessToken, ExecutorServiceRegistry.class, serviceRegistryParam);
  // add services
  xxlRpcProviderFactory.addService(ExecutorBiz.class.getName(), null, new ExecutorBizImpl());
  // start
  xxlRpcProviderFactory.start();
}
origin: xuxueli/xxl-job

private void stopRpcProvider() {
  // stop invoker factory
  try {
    XxlRpcInvokerFactory.getInstance().stop();
  } catch (Exception e) {
    logger.error(e.getMessage(), e);
  }
  // stop provider factory
  try {
    xxlRpcProviderFactory.stop();
  } catch (Exception e) {
    logger.error(e.getMessage(), e);
  }
}
origin: xuxueli/xxl-job

private void initRpcProvider(){
  // init
  XxlRpcProviderFactory xxlRpcProviderFactory = new XxlRpcProviderFactory();
  xxlRpcProviderFactory.initConfig(
      NetEnum.JETTY,
      Serializer.SerializeEnum.HESSIAN.getSerializer(),
      null,
      0,
      XxlJobAdminConfig.getAdminConfig().getAccessToken(),
      null,
      null);
  // add services
  xxlRpcProviderFactory.addService(AdminBiz.class.getName(), null, XxlJobAdminConfig.getAdminConfig().getAdminBiz());
  // jetty handler
  jettyServerHandler = new JettyServerHandler(xxlRpcProviderFactory);
}
private void stopRpcProvider() throws Exception {
origin: com.xuxueli/xxl-job-core

private void initRpcProvider(String ip, int port, String appName, String accessToken) throws Exception {
  // init invoker factory
  xxlRpcInvokerFactory = new XxlRpcInvokerFactory();
  // init, provider factory
  String address = IpUtil.getIpPort(ip, port);
  Map<String, String> serviceRegistryParam = new HashMap<String, String>();
  serviceRegistryParam.put("appName", appName);
  serviceRegistryParam.put("address", address);
  xxlRpcProviderFactory = new XxlRpcProviderFactory();
  xxlRpcProviderFactory.initConfig(NetEnum.JETTY, Serializer.SerializeEnum.HESSIAN.getSerializer(), ip, port, accessToken, ExecutorServiceRegistry.class, serviceRegistryParam);
  // add services
  xxlRpcProviderFactory.addService(ExecutorBiz.class.getName(), null, new ExecutorBizImpl());
  // start
  xxlRpcProviderFactory.start();
}
origin: xuxueli/xxl-mq

public void destoryServer() throws Exception {
  // stop server
  if (providerFactory != null) {
    providerFactory.stop();
  }
}
origin: xuxueli/xxl-mq

public void initServer() throws Exception {
  // address, static registry
  ip = (ip!=null&&ip.trim().length()>0)?ip:IpUtil.getIp();
  String address = IpUtil.getIpPort(ip, port);
  XxlCommonRegistryData xxlCommonRegistryData = new XxlCommonRegistryData();
  xxlCommonRegistryData.setKey(IXxlMqBroker.class.getName());
  xxlCommonRegistryData.setValue(address);
  XxlCommonRegistryServiceImpl.staticRegistryData = xxlCommonRegistryData;
  // init server
  providerFactory = new XxlRpcProviderFactory();
  providerFactory.initConfig(NetEnum.NETTY, Serializer.SerializeEnum.HESSIAN.getSerializer(), ip, port, null, null, null);
  // add server
  providerFactory.addService(IXxlMqBroker.class.getName(), null, this);
  // start server
  providerFactory.start();
}
origin: com.xuxueli/xxl-job-core

private void stopRpcProvider() {
  // stop invoker factory
  try {
    xxlRpcInvokerFactory.stop();
  } catch (Exception e) {
    logger.error(e.getMessage(), e);
  }
  // stop provider factory
  try {
    xxlRpcProviderFactory.stop();
  } catch (Exception e) {
    logger.error(e.getMessage(), e);
  }
}
com.xxl.rpc.remoting.providerXxlRpcProviderFactory

Most used methods

  • <init>
  • addService
  • initConfig
  • start
  • stop

Popular in Java

  • Making http post requests using okhttp
  • requestLocationUpdates (LocationManager)
  • addToBackStack (FragmentTransaction)
  • getResourceAsStream (ClassLoader)
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • TreeMap (java.util)
    Walk the nodes of the tree left-to-right or right-to-left. Note that in descending iterations, next
  • BoxLayout (javax.swing)
  • IsNull (org.hamcrest.core)
    Is the value null?
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now