ArmeriaConnector(Server server) { this.server = server; executor = server.getThreadPool(); final HttpConfiguration httpConfig = server.getBean(HttpConfiguration.class); this.httpConfig = httpConfig != null ? httpConfig : new HttpConfiguration(); final Scheduler scheduler = server.getBean(Scheduler.class); this.scheduler = scheduler != null ? scheduler : new ScheduledExecutorScheduler(); final ByteBufferPool byteBufferPool = server.getBean(ByteBufferPool.class); this.byteBufferPool = byteBufferPool != null ? byteBufferPool : new ArrayByteBufferPool(); addBean(server, false); addBean(executor); unmanage(executor); addBean(this.httpConfig); addBean(this.scheduler); addBean(this.byteBufferPool); connectionFactory = new ArmeriaConnectionFactory(); connectionFactories = Collections.singleton(connectionFactory); }
/** Get/Set/Create the server default Configuration ClassList. * <p>Get the class list from: a Server bean; or the attribute (which can * either be a ClassList instance or an String[] of class names); or a new instance * with default configuration classes.</p> * <p>This method also adds the obtained ClassList instance as a dependent bean * on the server and clears the attribute</p> * @param server The server the default is for * @return the server default ClassList instance of the configuration classes for this server. Changes to this list will change the server default instance. */ public static ClassList setServerDefault(Server server) { ClassList cl=server.getBean(ClassList.class); if (cl!=null) return cl; cl=serverDefault(server); server.addBean(cl); server.setAttribute(ATTR,null); return cl; }
/** Get/Create the server default Configuration ClassList. * <p>Get the class list from: a Server bean; or the attribute (which can * either be a ClassList instance or an String[] of class names); or a new instance * with default configuration classes. * @param server The server the default is for * @return A copy of the server default ClassList instance of the configuration classes for this server. Changes to the returned list will not change the server default. */ public static ClassList serverDefault(Server server) { ClassList cl=null; if (server!=null) { cl= server.getBean(ClassList.class); if (cl!=null) return new ClassList(cl); Object attr = server.getAttribute(ATTR); if (attr instanceof ClassList) return new ClassList((ClassList)attr); if (attr instanceof String[]) return new ClassList((String[])attr); } return new ClassList(); }
protected IdentityService findIdentityService() { return getServer().getBean(IdentityService.class); }
public static ErrorHandler getErrorHandler(Server server, ContextHandler context) { ErrorHandler error_handler=null; if (context!=null) error_handler=context.getErrorHandler(); if (error_handler==null && server!=null) error_handler = server.getBean(ErrorHandler.class); return error_handler; } }
public static ErrorHandler getErrorHandler(Server server, ContextHandler context) { ErrorHandler error_handler=null; if (context!=null) error_handler=context.getErrorHandler(); if (error_handler==null && server!=null) error_handler = server.getBean(ErrorHandler.class); return error_handler; } }
public static ErrorHandler getErrorHandler(Server server, ContextHandler context) { ErrorHandler error_handler=null; if (context!=null) error_handler=context.getErrorHandler(); if (error_handler==null && server!=null) error_handler = server.getBean(ErrorHandler.class); return error_handler; } }
protected IdentityService findIdentityService() { return getServer().getBean(IdentityService.class); }
protected IdentityService findIdentityService() { return getServer().getBean(IdentityService.class); }
protected IdentityService findIdentityService() { return getServer().getBean(IdentityService.class); }
protected IdentityService findIdentityService() { return getServer().getBean(IdentityService.class); }
protected IdentityService findIdentityService() { return getServer().getBean(IdentityService.class); }
protected IdentityService findIdentityService() { return getServer().getBean(IdentityService.class); }
@Override public void customize(final Server server) { final QueuedThreadPool threadPool = server.getBean(QueuedThreadPool.class); threadPool.setMaxThreads(Integer.parseInt(this.maxThreads)); threadPool.setMinThreads(Integer.parseInt(this.minThreads)); threadPool.setIdleTimeout(Integer.parseInt(this.idleTimeout)); }
@Override public void customize(final Server server) { final QueuedThreadPool threadPool = server.getBean(QueuedThreadPool.class); threadPool.setMaxThreads(Integer.parseInt(this.maxThreads)); threadPool.setMinThreads(Integer.parseInt(this.minThreads)); threadPool.setIdleTimeout(Integer.parseInt(this.idleTimeout)); }
@Override protected void doStart() throws Exception { _scheduler = _server.getBean(Scheduler.class); if (_scheduler==null) { _scheduler=new LRMScheduler(); _scheduler.start(); } super.doStart(); _scheduler.schedule(_monitor,_period,TimeUnit.MILLISECONDS); }
@Override protected void doStart() throws Exception { _scheduler = _server.getBean(Scheduler.class); if (_scheduler==null) { _scheduler=new LRMScheduler(); _scheduler.start(); } super.doStart(); _scheduler.schedule(_monitor,_period,TimeUnit.MILLISECONDS); }
@Override protected void doStart() throws Exception { _scheduler = _server.getBean(Scheduler.class); if (_scheduler==null) { _scheduler=new LRMScheduler(); _scheduler.start(); } super.doStart(); _scheduler.schedule(_monitor,_period,TimeUnit.MILLISECONDS); }
@Override protected void doStart() throws Exception { _scheduler = _server.getBean(Scheduler.class); if (_scheduler==null) { _scheduler=new LRMScheduler(); _scheduler.start(); } super.doStart(); _scheduler.schedule(_monitor,_period,TimeUnit.MILLISECONDS); }
@Override protected void doStart() throws Exception { _scheduler = _server.getBean(Scheduler.class); if (_scheduler==null) { _scheduler=new LRMScheduler(); _scheduler.start(); } super.doStart(); _scheduler.schedule(_monitor,_period,TimeUnit.MILLISECONDS); }