/// <summary>
 /// Adds a new destination.
 /// </summary>
 /// <param name="destination">Destination definition instance.</param>
 public void AddDestination(DestinationDefinition destination)
 {
     if (_destinations == null)
         _destinations = new DestinationDefinition[1];
     else
         _destinations = ArrayUtils.Resize(_destinations, _destinations.Length + 1) as DestinationDefinition[];
     _destinations[_destinations.Length - 1] = destination;
 }
예제 #2
0
        /// <summary>
        /// Initializes a new instance of the RemotingDestination class.
        /// </summary>
        /// <param name="service">Service.</param>
        /// <param name="destinationDefinition">Destination definition.</param>
        public RemotingDestination(IService service, DestinationDefinition destinationDefinition)
            : base(service, destinationDefinition)
		{
		}
        /// <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;
        }
예제 #4
0
        public DataDestination(IService service, DestinationDefinition destinationDefinition)
            : base(service, destinationDefinition)
		{
			_sequenceManager = new SequenceManager(this);
		}
예제 #5
0
        internal Destination(IService service, DestinationDefinition destinationDefinition)
		{
			_service = service;
            _destinationDefinition = destinationDefinition;
            _initialized = false;
		}
예제 #6
0
 internal void SetDestinationSettings(DestinationDefinition value)
 {
     _destinationDefinition = value;
 }
예제 #7
0
        public MessageDestination(IService service, DestinationDefinition destinationDefinition)
            : base(service, destinationDefinition)
		{
			_subscriptionManager = new SubscriptionManager(this);
		}
예제 #8
0
        protected override Destination NewDestination(DestinationDefinition destinationDefinition)
		{
            return new MessageDestination(this, destinationDefinition);
		}
예제 #9
0
        protected override Destination NewDestination(DestinationDefinition destinationDefinition)
		{
            RemotingDestination remotingDestination = new RemotingDestination(this, destinationDefinition);
			return remotingDestination;
		}
예제 #10
0
        /// <summary>
        /// Creates a new Destination.
        /// </summary>
        /// <param name="destinationDefinition">Destination settings.</param>
        /// <returns>The new Destination instance.</returns>
        protected virtual Destination NewDestination(DestinationDefinition destinationDefinition)
		{
            return new Destination(this, destinationDefinition);
		}
예제 #11
0
        /// <summary>
        /// Creates a destination with the specified settings.
        /// </summary>
        /// <param name="destinationDefinition">Destination settings.</param>
        /// <param name="adapterDefinition">Adapter settings.</param>
        /// <returns>The created destination instance.</returns>
        public virtual Destination CreateDestination(DestinationDefinition destinationDefinition, AdapterDefinition adapterDefinition)
		{
			lock(_objLock)
			{
                if (!_destinations.ContainsKey(destinationDefinition.Id))
				{
                    Destination destination = NewDestination(destinationDefinition);
                    destination.Init(adapterDefinition);
                    /*
                    if (destinationDefinition.Adapter != null)
                        destination.Init(destinationSettings.Adapter);
					else
                        destination.Init(_serviceSettings.DefaultAdapter);
                    */
					_destinations[destination.Id] = destination;
					
					string source = destination.DestinationDefinition.Properties.Source;
					//TODO: warn if more then one "*" source occurs.
					if( source != null && source == "*" )
						_defaultDestination = destination;
					return destination;
				}
				else
                    return _destinations[destinationDefinition.Id] as Destination;
			}
		}
예제 #12
0
        private void InstallServiceBrowserDestinations(ServiceDefinition service, AdapterDefinition adapter)
        {
            //ServiceBrowser destinations
            DestinationDefinition destination = new DestinationDefinition(service);
            destination.Id = DestinationDefinition.FluorineServiceBrowserDestination;
            destination.Properties.Source = DestinationDefinition.FluorineServiceBrowserDestination;
            destination.AdapterRef = new AdapterRef(adapter);
            service.AddDestination(destination);

            destination = new DestinationDefinition(service);
            destination.Id = DestinationDefinition.FluorineManagementDestination;
            destination.Properties.Source = DestinationDefinition.FluorineManagementDestination;
            destination.AdapterRef = new AdapterRef(adapter);
            service.AddDestination(destination);

            destination = new DestinationDefinition(service);
            destination.Id = DestinationDefinition.FluorineCodeGeneratorDestination;
            destination.Properties.Source = DestinationDefinition.FluorineCodeGeneratorDestination;
            destination.AdapterRef = new AdapterRef(adapter);
            service.AddDestination(destination);

            destination = new DestinationDefinition(service);
            destination.Id = DestinationDefinition.FluorineSqlServiceDestination;
            destination.Properties.Source = DestinationDefinition.FluorineSqlServiceDestination;
            destination.AdapterRef = new AdapterRef(adapter);
            service.AddDestination(destination);
        }