Search in sources :

Example 1 with LoggerExceptionCaughtHandle

use of com.generallycloud.baseio.component.LoggerExceptionCaughtHandle in project baseio by generallycloud.

the class TestBalanceMain method main.

public static void main(String[] args) throws IOException {
    BalanceServerBootStrap f = new BalanceServerBootStrap();
    f.setBalanceProtocolFactory(new ProtobaseProtocolFactory());
    f.setBalanceReverseProtocolFactory(new ProtobaseProtocolFactory());
    f.setBalanceProtocolFactory(new ProtobaseProtocolFactory());
    f.setBalanceReverseProtocolFactory(new ProtobaseProtocolFactory());
    ServerConfiguration fc = new ServerConfiguration();
    fc.setSERVER_PORT(8600);
    ServerConfiguration frc = new ServerConfiguration();
    frc.setSERVER_PORT(8800);
    f.setFacadeExceptionCaughtHandle(new LoggerExceptionCaughtHandle());
    f.setReverseExceptionCaughtHandle(new LoggerExceptionCaughtHandle());
    f.setBalanceServerConfiguration(fc);
    f.setBalanceReverseServerConfiguration(frc);
    f.setFacadeInterceptor(new FacadeInterceptorImpl(500, 50000));
    f.setBalanceRouter(new HashedBalanceRouter(10240));
    // f.setBalanceRouter(new SimpleNextRouter());
    f.startup();
}
Also used : ProtobaseProtocolFactory(com.generallycloud.baseio.codec.protobase.ProtobaseProtocolFactory) LoggerExceptionCaughtHandle(com.generallycloud.baseio.component.LoggerExceptionCaughtHandle) ServerConfiguration(com.generallycloud.baseio.configuration.ServerConfiguration) HashedBalanceRouter(com.generallycloud.baseio.balance.router.HashedBalanceRouter) FacadeInterceptorImpl(com.generallycloud.baseio.balance.FacadeInterceptorImpl) BalanceServerBootStrap(com.generallycloud.baseio.balance.BalanceServerBootStrap)

Example 2 with LoggerExceptionCaughtHandle

use of com.generallycloud.baseio.component.LoggerExceptionCaughtHandle in project baseio by generallycloud.

the class ApplicationContext method doStart.

@Override
protected void doStart() throws Exception {
    if (channelContext == null) {
        throw new IllegalArgumentException("null nio context");
    }
    if (StringUtil.isNullOrBlank(rootLocalAddress)) {
        throw new IllegalArgumentException("rootLocalAddress");
    }
    if (futureAcceptorServiceFilter == null) {
        this.futureAcceptorServiceFilter = new FutureAcceptorServiceFilter();
    }
    if (appRedeployService == null) {
        appRedeployService = new SystemRedeployServlet();
    }
    if (acLoader == null) {
        acLoader = new FileSystemACLoader();
    }
    if (exceptionCaughtHandle == null) {
        exceptionCaughtHandle = new LoggerExceptionCaughtHandle();
    }
    if (ioExceptionCaughtHandle == null) {
        ioExceptionCaughtHandle = new LoggerExceptionCaughtHandle();
    }
    instance = this;
    this.rootLocalAddress = FileUtil.getPrettyPath(rootLocalAddress);
    this.encoding = channelContext.getEncoding();
    this.appLocalAddres = FileUtil.getPrettyPath(getRootLocalAddress() + "app");
    LoggerUtil.prettyLog(logger, "application path      :{ {} }", appLocalAddres);
    this.initializeApplicationContext();
}
Also used : SystemRedeployServlet(com.generallycloud.baseio.container.implementation.SystemRedeployServlet) FileSystemACLoader(com.generallycloud.baseio.container.configuration.FileSystemACLoader) FutureAcceptorServiceFilter(com.generallycloud.baseio.container.service.FutureAcceptorServiceFilter) LoggerExceptionCaughtHandle(com.generallycloud.baseio.component.LoggerExceptionCaughtHandle)

Aggregations

LoggerExceptionCaughtHandle (com.generallycloud.baseio.component.LoggerExceptionCaughtHandle)2 BalanceServerBootStrap (com.generallycloud.baseio.balance.BalanceServerBootStrap)1 FacadeInterceptorImpl (com.generallycloud.baseio.balance.FacadeInterceptorImpl)1 HashedBalanceRouter (com.generallycloud.baseio.balance.router.HashedBalanceRouter)1 ProtobaseProtocolFactory (com.generallycloud.baseio.codec.protobase.ProtobaseProtocolFactory)1 ServerConfiguration (com.generallycloud.baseio.configuration.ServerConfiguration)1 FileSystemACLoader (com.generallycloud.baseio.container.configuration.FileSystemACLoader)1 SystemRedeployServlet (com.generallycloud.baseio.container.implementation.SystemRedeployServlet)1 FutureAcceptorServiceFilter (com.generallycloud.baseio.container.service.FutureAcceptorServiceFilter)1