コード例 #1
0
ファイル: DataService.cs プロジェクト: GodLesZ/svn-dump
		//private ILog _coreDumpLog = null;

		public DataService(MessageBroker messageBroker, ServiceDefinition serviceDefinition)
			: base(messageBroker, serviceDefinition) {
			/*
			try
			{
				_coreDumpLog = LogManager.GetLogger("GodLesZ.Library.Amf.Dump");
			}
			catch{}
			*/
		}
コード例 #2
0
ファイル: ServiceBase.cs プロジェクト: GodLesZ/svn-dump
		internal ServiceBase(MessageBroker messageBroker, ServiceDefinition serviceDefinition) {
			_messageBroker = messageBroker;
			_serviceDefinition = serviceDefinition;

			_destinations = new Hashtable();
			if (this.ServiceDefinition.Destinations != null) {
				foreach (DestinationDefinition destinationDefinition in this.ServiceDefinition.Destinations) {
					AdapterDefinition adapterDefinition = null;
					AdapterRef adapterRef = destinationDefinition.AdapterRef;
					if (adapterRef != null)
						adapterDefinition = serviceDefinition.GetAdapterByRef(adapterRef.Ref);
					else
						adapterDefinition = serviceDefinition.GetDefaultAdapter();
					CreateDestination(destinationDefinition, adapterDefinition);
				}
			}
		}
コード例 #3
0
		public AuthenticationService(MessageBroker broker, ServiceDefinition serviceDefinition)
			: base(broker, serviceDefinition) {
		}
コード例 #4
0
ファイル: RemotingService.cs プロジェクト: GodLesZ/svn-dump
		public RemotingService(MessageBroker broker, ServiceDefinition serviceDefinition)
			: base(broker, serviceDefinition) {
		}
コード例 #5
0
ファイル: MessageService.cs プロジェクト: GodLesZ/svn-dump
		/// <summary>
		/// Initializes a new instance of the MessageService class.
		/// </summary>
		/// <param name="messageBroker"></param>
		/// <param name="serviceDefinition"></param>
		public MessageService(MessageBroker messageBroker, ServiceDefinition serviceDefinition)
			: base(messageBroker, serviceDefinition) {
		}
コード例 #6
0
ファイル: MessageServer.cs プロジェクト: GodLesZ/svn-dump
		private void InitAuthenticationService() {
			ServiceDefinition serviceDefinition = new ServiceDefinition(_servicesConfiguration);
			serviceDefinition.Id = AuthenticationService.ServiceId;
			serviceDefinition.Class = typeof(AuthenticationService).FullName;
			serviceDefinition.MessageTypes = "flex.messaging.messages.AuthenticationMessage";
			_servicesConfiguration.Services.AddService(serviceDefinition);
			AuthenticationService service = new AuthenticationService(_messageBroker, serviceDefinition);
			_messageBroker.AddService(service);
		}
コード例 #7
0
ファイル: MessageServer.cs プロジェクト: GodLesZ/svn-dump
		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);
		}
コード例 #8
0
		internal DestinationDefinition(ServiceDefinition service) {
			_service = service;
		}
コード例 #9
0
		internal void Load(ServicesConfiguration parent, string rootPath) {
			_serviceDefinition = ServiceDefinition.Load(parent, Path.Combine(rootPath, this.FilePath));
		}
コード例 #10
0
		/// <summary>
		/// Adds a new service definition to the services element.
		/// </summary>
		/// <param name="service">A service definition instance.</param>
		public void AddService(ServiceDefinition service) {
			if (_services == null)
				_services = new ServiceDefinition[1];
			else
				_services = ArrayUtils.Resize(_services, _services.Length + 1) as ServiceDefinition[];
			_services[_services.Length - 1] = service;
		}
コード例 #11
0
		/// <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;
		}