public void Start()
        {
            if (_serviceHost != null)
            {
                throw new InvalidOperationException("Server is already started.");
            }

            var managementHandler = new ManagementTransferRequestHandler();
            managementHandler.Bind(Schema.DynamicMBeanResourceUri, new DynamicMBeanManagementRequestHandler(_server));
            managementHandler.Bind(Schema.MBeanServerResourceUri, new MBeanServerManagementRequestHandler(_server));

            var enumerationServer = new EnumerationServer();
            enumerationServer.Bind(Schema.DynamicMBeanResourceUri, Schema.QueryNamesDialect, typeof(string), new QueryNamesEnumerationRequestHandler(_server));
            enumerationServer.Bind(Schema.DynamicMBeanResourceUri, FilterMap.DefaultDialect, typeof(void), new IsRegisteredEnumerationRequestHandler(_server));

            var eventingServer = new EventingServer(new EventingRequestHandler(_server));
            eventingServer.Bind(Schema.NotificationDialect, typeof (NotificationFilter));
            eventingServer.EnablePullDeliveryUsing(enumerationServer.PullServer);

            var extensionHandler = new Jsr262ExtensionMethodHandler(_server);

            _serviceHost = new HttpListenerTransferEndpoint(_serviceUrl,
                new TransferServer(managementHandler),
                enumerationServer,
                enumerationServer,
                eventingServer,
                extensionHandler);
        }
        public static void RegisterRoutes(RouteCollection routes)
        {
            var handler = new ManagementTransferRequestHandler();
            handler.Bind(ResourceUri, new Handler());
            var transferServer = new TransferServer(handler);

            routes.Add(new Route("management", new SOAPRouteHandler(transferServer)));
        }
Beispiel #3
0
        static void Main(string[] args)
        {
            XmlConfigurator.Configure();
            var handler = new ManagementTransferRequestHandler();
            handler.Bind(ResourceUri, new Handler());

            var transferServer = new TransferServer(handler);
            using (new HttpListenerTransferEndpoint("http://localhost:12345/", transferServer))
            {
                Client.PerformTest();
                Console.WriteLine("Press any key to exit.");
                Console.ReadKey();
            }
        }