@Test public void testNotify() { ProtocolBinding pb = new ProtocolBinding(null, null, Protocol.RESCRIPT); Set<ProtocolBinding> bindingSet = new HashSet<ProtocolBinding>(); bindingSet.add(pb); ProtocolBindingRegistry bindingReg = Mockito.mock(ProtocolBindingRegistry.class); when(bindingReg.getProtocolBindings()).thenReturn(bindingSet); JettyHttpTransport transport = new JettyHttpTransport(); transport.setProtocolBindingRegistry(bindingReg); transport.setCommandProcessorFactory(factory); assertTrue("Should be no entry in the handlerSpecMap", transport.getHandlerSpecificationMap().isEmpty()); transport.registerHandler(rescriptServiceBindingDescriptor); assertTrue("should be one entry in the handlerSpecMap", transport.getHandlerSpecificationMap().size() == 1); verify(commandProc).bind(eq(rescriptServiceBindingDescriptor)); }
@Override public void notify(BindingDescriptor bindingDescriptor) { if (bindingDescriptor.getServiceProtocol().underlyingTransportIsHttp()) { serviceBindingDescriptors.add((HttpServiceBindingDescriptor) bindingDescriptor); registerHandler((HttpServiceBindingDescriptor) bindingDescriptor); } }
JettyHttpTransport extends AbstractRegisterableTransport implements GateListener { @Override public void notify(BindingDescriptor bindingDescriptor) { if (bindingDescriptor.getServiceProtocol().underlyingTransportIsHttp()) { serviceBindingDescriptors.add((HttpServiceBindingDescriptor) bindingDescriptor); registerHandler((HttpServiceBindingDescriptor) bindingDescriptor); } } }
JettyHttpTransport extends AbstractRegisterableTransport implements GateListener { @Override public void notify(BindingDescriptor bindingDescriptor) { if (bindingDescriptor.getServiceProtocol().underlyingTransportIsHttp()) { serviceBindingDescriptors.add((HttpServiceBindingDescriptor) bindingDescriptor); registerHandler((HttpServiceBindingDescriptor) bindingDescriptor); } } JettyHttpTransport(); }
JettyHttpTransport extends AbstractRegisterableTransport implements GateListener { @Override public void notify(BindingDescriptor bindingDescriptor) { if (bindingDescriptor.getServiceProtocol().underlyingTransportIsHttp()) { serviceBindingDescriptors.add((HttpServiceBindingDescriptor) bindingDescriptor); registerHandler((HttpServiceBindingDescriptor) bindingDescriptor); } } JettyHttpTransport(); @Override String getName(); @Override int getPriority(); @Override void onCougarStart(); void setStartingGate(CougarStartingGate startingGate); @Override void notify(BindingDescriptor bindingDescriptor); void start(); void stop(); void initialiseStaticJettyConfig(); void registerHandler(HttpServiceBindingDescriptor serviceBindingDescriptor); void setServerWrapper(JettyServerWrapper server); JettyServerWrapper getServerWrapper(); void setDefaultCommandProcessor(HttpCommandProcessor defaultCommandProcessor); void setProtocolBindingRegistry(ProtocolBindingRegistry protocolBindingRegistry); void setTimeoutInSeconds(int timeoutInSeconds); Server getJettyServer(); StaticContentServiceHandler getWsdlStaticHandler(); StaticContentServiceHandler getHtmlStaticHandler(); Map<String, JettyHandlerSpecification> getHandlerSpecificationMap(); void setCommandProcessorFactory(TransportCommandProcessorFactory<HttpCommandProcessor> commandProcessorFactory); void setWsdlContextPath(String wsdlContextPath); void setWsdlRegex(String wsdlRegex); void setWsdlMediaType(String wsdlMediaType); void setHtmlContextPath(String htmlContextPath); void setHtmlRegex(String htmlRegex); void setHtmlMediaType(String htmlMediaType); void setGeoLocationDeserializer(GeoLocationDeserializer deserializer); void setRequestLogger(RequestLogger requestLogger); void setUuidHeader(String uuidHeader); void setUuidParentsHeader(String uuidParentsHeader); void setGeoIPLocator(GeoIPLocator geoIPLocator); void setJettyEndPoints(JettyEndpoints jettyEndPoints); void setJmxControl(JMXControl jmxControl); void setPathAliases(Map<String, String> pathAliases); @ManagedAttribute Map<String, String> getPathAliases(); @ManagedAttribute boolean isHttpEnabled(); @ManagedAttribute boolean isHttpsEnabled(); @ManagedAttribute int getRequestHeaderSize(); @ManagedAttribute int getResponseBufferSize(); @ManagedAttribute int getResponseHeaderSize(); @ManagedAttribute int getHttpAcceptors(); @ManagedAttribute int getHttpSelectors(); @ManagedAttribute int getHttpsAcceptors(); @ManagedAttribute int getHttpsSelectors(); @ManagedAttribute boolean isHttpForwarded(); @ManagedAttribute boolean isHttpsForwarded(); @ManagedAttribute boolean isGzipEnabled(); void setGzipEnabled(boolean gzipEnabled); @ManagedAttribute String getExcludedAgents(); void setGzipExcludedAgents(String excludedAgents); @ManagedAttribute int getGzipBufferSize(); void setGzipBufferSize(int bufferSize); @ManagedAttribute int getGzipMinSize(); void setGzipMinSize(int minSize); @ManagedAttribute boolean isCorsEnabled(); void setCorsEnabled(boolean corsEnabled); @ManagedAttribute String getCorsAllowedOrigins(); void setCorsAllowedOrigins(String corsAllowedOrigins); @ManagedAttribute String getCorsAllowedMethods(); void setCorsAllowedMethods(String corsAllowedMethods); @ManagedAttribute String getCorsAllowedHeaders(); void setCorsAllowedHeaders(String corsAllowedHeaders); @ManagedAttribute String getCorsMaxAge(); void setCorsMaxAge(String corsMaxAge); @ManagedAttribute String getCorsPreflightMaxAge(); void setCorsPreflightMaxAge(String corsPreflightMaxAge); @ManagedAttribute String getCorsAllowCredentials(); void setCorsAllowCredentials(String corsAllowCredentials); @ManagedAttribute String getCorsExposedHeaders(); void setCorsExposedHeaders(String corsExposedHeaders); int getMaxFormContentSize(); @ManagedAttribute int getHttpAcceptQueueSize(); @ManagedAttribute int getHttpsAcceptQueueSize(); @ManagedAttribute long getLowResourcesMaxMemory(); @ManagedAttribute int getLowResourcesMaxConnections(); @ManagedAttribute int getLowResourcesPeriod(); @ManagedAttribute int getLowResourcesMaxTime(); @ManagedAttribute int getLowResourcesIdleTime(); @ManagedAttribute boolean isLowResourcesMonitorThreads(); @ManagedAttribute boolean isSuppressCommasInAccessLogForStaticHtml(); void setSuppressCommasInAccessLogForStaticHtml(boolean suppressCommasInAccessLogForStaticHtml); @ManagedAttribute boolean isSuppressCommasInAccessLogForCalls(); void setSuppressCommasInAccessLogForCalls(boolean suppressCommasInAccessLogForCalls); ContextHandlerCollection getHandlerCollection(); }
JettyHttpTransport extends AbstractRegisterableTransport implements GateListener { @Override public void notify(BindingDescriptor bindingDescriptor) { if (bindingDescriptor.getServiceProtocol().underlyingTransportIsHttp()) { serviceBindingDescriptors.add((HttpServiceBindingDescriptor) bindingDescriptor); registerHandler((HttpServiceBindingDescriptor) bindingDescriptor); } } JettyHttpTransport(); @Override String getName(); @Override int getPriority(); @Override void onCougarStart(); void setStartingGate(CougarStartingGate startingGate); @Override void notify(BindingDescriptor bindingDescriptor); void start(); void stop(); void initialiseStaticJettyConfig(); void registerHandler(HttpServiceBindingDescriptor serviceBindingDescriptor); void setServerWrapper(JettyServerWrapper server); JettyServerWrapper getServerWrapper(); void setDefaultCommandProcessor(HttpCommandProcessor defaultCommandProcessor); void setProtocolBindingRegistry(ProtocolBindingRegistry protocolBindingRegistry); void setTimeoutInSeconds(int timeoutInSeconds); Server getJettyServer(); StaticContentServiceHandler getWsdlStaticHandler(); StaticContentServiceHandler getHtmlStaticHandler(); Map<String, JettyHandlerSpecification> getHandlerSpecificationMap(); void setCommandProcessorFactory(TransportCommandProcessorFactory<HttpCommandProcessor> commandProcessorFactory); void setWsdlContextPath(String wsdlContextPath); void setWsdlRegex(String wsdlRegex); void setWsdlMediaType(String wsdlMediaType); void setHtmlContextPath(String htmlContextPath); void setHtmlRegex(String htmlRegex); void setHtmlMediaType(String htmlMediaType); void setGeoLocationDeserializer(GeoLocationDeserializer deserializer); void setRequestLogger(RequestLogger requestLogger); void setUuidHeader(String uuidHeader); void setUuidParentsHeader(String uuidParentsHeader); void setGeoIPLocator(GeoIPLocator geoIPLocator); void setJettyEndPoints(JettyEndpoints jettyEndPoints); void setJmxControl(JMXControl jmxControl); void setPathAliases(Map<String, String> pathAliases); @ManagedAttribute Map<String, String> getPathAliases(); @ManagedAttribute boolean isHttpEnabled(); @ManagedAttribute boolean isHttpsEnabled(); @ManagedAttribute int getRequestHeaderSize(); @ManagedAttribute int getResponseBufferSize(); @ManagedAttribute int getResponseHeaderSize(); @ManagedAttribute int getHttpAcceptors(); @ManagedAttribute int getHttpSelectors(); @ManagedAttribute int getHttpsAcceptors(); @ManagedAttribute int getHttpsSelectors(); @ManagedAttribute boolean isHttpForwarded(); @ManagedAttribute boolean isHttpsForwarded(); @ManagedAttribute boolean isGzipEnabled(); void setGzipEnabled(boolean gzipEnabled); @ManagedAttribute String getExcludedAgents(); void setGzipExcludedAgents(String excludedAgents); @ManagedAttribute int getGzipBufferSize(); void setGzipBufferSize(int bufferSize); @ManagedAttribute int getGzipMinSize(); void setGzipMinSize(int minSize); @ManagedAttribute boolean isCorsEnabled(); void setCorsEnabled(boolean corsEnabled); @ManagedAttribute String getCorsAllowedOrigins(); void setCorsAllowedOrigins(String corsAllowedOrigins); @ManagedAttribute String getCorsAllowedMethods(); void setCorsAllowedMethods(String corsAllowedMethods); @ManagedAttribute String getCorsAllowedHeaders(); void setCorsAllowedHeaders(String corsAllowedHeaders); @ManagedAttribute String getCorsMaxAge(); void setCorsMaxAge(String corsMaxAge); @ManagedAttribute String getCorsPreflightMaxAge(); void setCorsPreflightMaxAge(String corsPreflightMaxAge); @ManagedAttribute String getCorsAllowCredentials(); void setCorsAllowCredentials(String corsAllowCredentials); @ManagedAttribute String getCorsExposedHeaders(); void setCorsExposedHeaders(String corsExposedHeaders); int getMaxFormContentSize(); @ManagedAttribute int getHttpAcceptQueueSize(); @ManagedAttribute int getHttpsAcceptQueueSize(); @ManagedAttribute long getLowResourcesMaxMemory(); @ManagedAttribute int getLowResourcesMaxConnections(); @ManagedAttribute int getLowResourcesPeriod(); @ManagedAttribute int getLowResourcesMaxTime(); @ManagedAttribute int getLowResourcesIdleTime(); @ManagedAttribute boolean isLowResourcesMonitorThreads(); @ManagedAttribute boolean isSuppressCommasInAccessLogForStaticHtml(); void setSuppressCommasInAccessLogForStaticHtml(boolean suppressCommasInAccessLogForStaticHtml); @ManagedAttribute boolean isSuppressCommasInAccessLogForCalls(); void setSuppressCommasInAccessLogForCalls(boolean suppressCommasInAccessLogForCalls); ContextHandlerCollection getHandlerCollection();  }