public void BeforeRegister(MServer server, ManagedObjectName name) { this.server = server; this.name = name; RegisterServer(); }
public void BeforeRegister(MServer server, ManagedObjectName name) { Assertion.AssertNotNull(server); Assertion.AssertNotNull(name); beforeRegisterCalled = state++; }
public MServerProxy(MServer server) { if (server == null) { throw new ArgumentNullException("server"); } this.server = server; }
public MServerProxyDecorator(MServer server) { if (server == null) { throw new ArgumentNullException("server"); } this.server = server; }
public MDefaultRegistry(MServer server) { if (server == null) { throw new ArgumentNullException("server"); } this.server = server; }
internal MConnector(MServer remoteServer, IChannel channel) { if (remoteServer == null) { throw new ArgumentNullException("remoteServer"); } this.remoteServer = remoteServer; this.channel = channel; }
public MConnectorServer(MServer server, String objectUri) : this(objectUri) { if (IsProxy(server)) { throw new ArgumentException("Argument can't be transparent proxy", "server"); } this.server = server; RegisterServer(); }
public void Disconnect() { if (remoteServer != null) { remoteServer = null; } if (channel != null) { ChannelServices.UnregisterChannel( channel ); channel = null; } }
public String[] TestClientCreation() { using (MConnector connector = MConnectorFactory.CreateConnector("provider:http:binary:test.rem", null)) { Assertion.AssertNotNull(connector); Assertion.AssertNotNull(connector.ServerConnection); MServer server = (MServer)connector.ServerConnection; String[] domains = server.GetDomains(); Assertion.AssertNotNull(domains); return(domains); } }
public void MBeanInstantiationWithinAppDomain() { MServer server = null; try { server = MServerFactory.CreateServer(true); AssertNotNull(server); Assert(RemotingServices.IsTransparentProxy(server)); } finally { MServerFactory.Release(server); } }
public void Init(IKernel kernel, IConfiguration config) { _kernel = kernel; _mserver = MServerFactory.CreateServer("castle.domain", false); _serverConn = MConnectorServerFactory.CreateServer( "provider:http:binary:test.rem", null, _mserver); _kernel.ComponentModelBuilder.AddContributor( new ManagementExtensionModelServerInspector()); _kernel.ComponentCreated += new ComponentInstanceDelegate(OnComponentCreated); _kernel.ComponentDestroyed += new ComponentInstanceDelegate(OnComponentDestroyed); }
public String[] TestTcpClientCreation() { System.Collections.Specialized.NameValueCollection props = new System.Collections.Specialized.NameValueCollection(); props.Add("port", "3131"); using (MConnector connector = MConnectorFactory.CreateConnector("provider:tcp:binary:test.rem", props)) { Assertion.AssertNotNull(connector); Assertion.AssertNotNull(connector.ServerConnection); MServer server = (MServer)connector.ServerConnection; Assertion.AssertNotNull(server.GetDomains()); return(server.GetDomains()); } }
public void Init(IKernel kernel, IConfiguration config) { _kernel = kernel; _mserver = MServerFactory.CreateServer( "castle.domain", false ); _serverConn = MConnectorServerFactory.CreateServer( "provider:http:binary:test.rem", null, _mserver ); _kernel.ComponentModelBuilder.AddContributor( new ManagementExtensionModelServerInspector() ); _kernel.ComponentCreated += new ComponentInstanceDelegate(OnComponentCreated); _kernel.ComponentDestroyed += new ComponentInstanceDelegate(OnComponentDestroyed); }
public override MConnector Connect(String url, NameValueCollection properties) { String[] parts = StripUrl(url); String formatter = parts[2]; String objectUri = parts[3]; String objectUrl = null; TcpChannel channel = CreateChannel(formatter, properties, false); objectUrl = String.Format("{0}://{1}:{2}/{3}", "tcp", GetHost(properties), GetPort(properties), objectUri); MServer proxy = (MServer)RemotingServices.Connect(typeof(MServerProxy), objectUrl); return(new MConnector((MServer)proxy, channel)); }
public void Disconnect() { if (remoteServer != null) { remoteServer = null; } if (channel != null) { try { ChannelServices.UnregisterChannel(channel); } catch (RemotingException) { // Somebody removed first } channel = null; } }
public void Disconnect() { if (remoteServer != null) { remoteServer = null; } if (channel != null) { try { ChannelServices.UnregisterChannel( channel ); } catch(RemotingException) { // Somebody removed first } channel = null; } }
/// <summary> /// Releases a <see cref="MServer"/> instance. This method /// accepts a null argument. /// </summary> /// <param name="server">The <see cref="MServer"/> instance to be released.</param> public static void Release(MServer server) { if (server != null) { foreach (DomainInfo info in domains.Values) { if (info.Server == server) { domains.Remove(info.Name); if (info.DedicatedDomain != null) { AppDomain.Unload(info.DedicatedDomain); } break; } } } }
public override MConnectorServer CreateServer(String url, NameValueCollection properties, MServer server) { String[] parts = StripUrl(url); String formatter = parts[2]; String objectUri = parts[3]; TcpChannel channel = CreateChannel(formatter, properties, true); MConnectorServer connServer = null; if (server != null) { connServer = new MConnectorServer(server, objectUri); } else { connServer = new MConnectorServer(objectUri); } return connServer; }
public static MConnectorServer CreateServer(String url, NameValueCollection properties, MServer server) { if (providers == null) { providers = new ArrayList(); // TODO: Search for providers instead of hard code it providers.Add (new Providers.HttpChannelProvider()); providers.Add (new Providers.TcpChannelProvider()); } foreach(MServerProvider provider in providers) { if (provider.Accepts(url)) { return provider.CreateServer(url, properties, server); } } throw new MProviderNotFoundException(url); }
public void Init() { server = MServerFactory.CreateServer("test", true); }
/// <summary> /// Releases a <see cref="MServer"/> instance. This method /// accepts a null argument. /// </summary> /// <param name="server">The <see cref="MServer"/> instance to be released.</param> public static void Release(MServer server) { if (server != null) { foreach(DomainInfo info in domains.Values) { if (info.Server == server) { domains.Remove( info.Name ); if (info.DedicatedDomain != null) { AppDomain.Unload( info.DedicatedDomain ); } break; } } } }
public DomainInfo(String name, MServer Server) : this(name) { this.Server = Server; }
public DomainInfo(String name, MServer Server, AppDomain domain) : this(name, Server) { this.DedicatedDomain = domain; }
public abstract MConnectorServer CreateServer(String url, System.Collections.Specialized.NameValueCollection properties, MServer server);
public override MConnectorServer CreateServer(String url, NameValueCollection properties, MServer server) { String[] parts = StripUrl(url); String formatter = parts[2]; String objectUri = parts[3]; TcpChannel channel = CreateChannel(formatter, properties, true); MConnectorServer connServer = null; if (server != null) { connServer = new MConnectorServer(server, objectUri); } else { connServer = new MConnectorServer(objectUri); } return(connServer); }
public static MConnectorServer CreateServer(String url, NameValueCollection properties, MServer server) { if (providers == null) { providers = new ArrayList(); // TODO: Search for providers instead of hard code it providers.Add(new Providers.HttpChannelProvider()); providers.Add(new Providers.TcpChannelProvider()); } foreach (MServerProvider provider in providers) { if (provider.Accepts(url)) { return(provider.CreateServer(url, properties, server)); } } throw new MProviderNotFoundException(url); }