/// <summary> /// Creates a FactoryInstance. /// </summary> /// <param name="id">The Destination identity.</param> /// <param name="properties">Configuration properties for the destination.</param> /// <returns>A FactoryInstance instance.</returns> public FactoryInstance CreateFactoryInstance(string id, DestinationProperties properties) { DotNetFactoryInstance factoryInstance = new DotNetFactoryInstance(this, id, properties); if (properties != null) { factoryInstance.Source = properties.Source; factoryInstance.Scope = properties.Scope; factoryInstance.AttributeId = properties.AttributeId; } if( factoryInstance.Scope == null ) factoryInstance.Scope = FactoryInstance.RequestScope; return factoryInstance; }
/// <summary> /// Creates a default services configuration instance. /// </summary> /// <returns>Services configuration instance.</returns> public static ServicesConfiguration CreateDefault() { ServicesConfiguration sc = new ServicesConfiguration(); LoginCommandCollection loginCommandCollection = FluorineConfiguration.Instance.LoginCommands; if (loginCommandCollection != null) { LoginCommand loginCommand = new LoginCommand(); loginCommand.Class = loginCommandCollection.GetLoginCommand(LoginCommandSettings.FluorineLoginCommand); loginCommand.Server = LoginCommandSettings.FluorineLoginCommand; SecurityConfiguration securityConfiguration = new SecurityConfiguration(); securityConfiguration.LoginCommands = new LoginCommand[] { loginCommand }; sc.Security = securityConfiguration; } //Create a default amf channel ChannelDefinition channelDefinition = new ChannelDefinition(); channelDefinition.Class = "flex.messaging.endpoints.AMFEndpoint"; channelDefinition.Id = "my-amf"; Endpoint endpoint = new Endpoint(); endpoint.Url = @"http://{server.name}:{server.port}/{context.root}/Gateway.aspx"; endpoint.Class = "flex.messaging.endpoints.AMFEndpoint"; channelDefinition.Endpoint = endpoint; sc.Channels = new ChannelDefinition[] { channelDefinition }; ServiceDefinition serviceDefinition = new ServiceDefinition(sc); serviceDefinition.Id = dotFlex.Messaging.Services.RemotingService.RemotingServiceId; serviceDefinition.Class = typeof(dotFlex.Messaging.Services.RemotingService).FullName; serviceDefinition.MessageTypes = "flex.messaging.messages.RemotingMessage"; AdapterDefinition adapter = new AdapterDefinition(); adapter.Id = "dotnet"; adapter.Class = typeof(dotFlex.Remoting.RemotingAdapter).FullName; adapter.Default = true; serviceDefinition.AddAdapter(adapter); serviceDefinition.Adapters = new AdapterDefinition[] { adapter }; AdapterRef adapterRef = new AdapterRef(); adapterRef.Ref = "dotnet"; DestinationDefinition destination = new DestinationDefinition(serviceDefinition); destination.Id = DestinationDefinition.FluorineDestination; destination.AdapterRef = adapterRef; DestinationProperties properties = new DestinationProperties(); properties.Source = "*"; destination.Properties = properties; serviceDefinition.AddDestination(destination); Services services = new Services(); services.ServiceDefinitions = new ServiceDefinition[] { serviceDefinition }; sc.Services = services; FlexClient flexClient = new FlexClient(); sc.FlexClient = flexClient; return sc; }
/// <summary> /// Initializes a new instance of the DotNetFactoryInstance class. /// </summary> /// <param name="flexFactory">The IFlexFactory this FactoryInstance is created from.</param> /// <param name="id">The Destination identity.</param> /// <param name="properties">The configuration properties for this destination.</param> public DotNetFactoryInstance(IFlexFactory flexFactory, string id, DestinationProperties properties) : base(flexFactory, id, properties) { }
/// <summary> /// Initializes a new instance of the FactoryInstance class. /// </summary> /// <param name="factory">The IFlexFactory this FactoryInstance is created from.</param> /// <param name="id">The Destination's id.</param> /// <param name="properties">The configuration properties for this destination.</param> public FactoryInstance(IFlexFactory factory, string id, DestinationProperties properties) { _factory = factory; _id = id; _properties = properties; }