Beispiel #1
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;
			}
		}
Beispiel #2
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);
		}
Beispiel #3
0
		public MessageDestination(IService service, DestinationDefinition destinationDefinition)
			: base(service, destinationDefinition) {
			_subscriptionManager = new SubscriptionManager(this);
		}
Beispiel #4
0
		public DataDestination(IService service, DestinationDefinition destinationDefinition)
			: base(service, destinationDefinition) {
			_sequenceManager = new SequenceManager(this);
		}
Beispiel #5
0
		protected override Destination NewDestination(DestinationDefinition destinationDefinition) {
			RemotingDestination remotingDestination = new RemotingDestination(this, destinationDefinition);
			return remotingDestination;
		}
Beispiel #6
0
		internal void SetDestinationSettings(DestinationDefinition value) {
			_destinationDefinition = value;
		}
Beispiel #7
0
		protected override Destination NewDestination(DestinationDefinition destinationDefinition) {
			return new MessageDestination(this, destinationDefinition);
		}
Beispiel #8
0
		internal Destination(IService service, DestinationDefinition destinationDefinition) {
			_service = service;
			_destinationDefinition = destinationDefinition;
			_initialized = false;
		}
Beispiel #9
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);
		}
		/// <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;
		}
		/// <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 = GodLesZ.Library.Amf.Messaging.Services.RemotingService.RemotingServiceId;
			serviceDefinition.Class = typeof(GodLesZ.Library.Amf.Messaging.Services.RemotingService).FullName;
			serviceDefinition.MessageTypes = "flex.messaging.messages.RemotingMessage";

			AdapterDefinition adapter = new AdapterDefinition();
			adapter.Id = "dotnet";
			adapter.Class = typeof(GodLesZ.Library.Amf.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;
		}