Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.kasource.kaevent.config;
 
 
 
import  com.google.inject.Inject;
import  com.google.inject.Injector;
import  com.google.inject.Key;
import  com.google.inject.Singleton;
import  com.google.inject.internal.Nullable;
import  com.google.inject.name.Named;

Configures the Ka-Event environment with Guice.

Author(s):
rikardwi
@Singleton
public class GuiceKaEventConfigurer extends KaEventConfigurer {
	@Inject
	private Injector injector;
	@Inject
	@Inject
	@Nullable
	@Inject
	@Named("kaEvent.scan.package")
	private String scanClassPath;

Configure the Ka-Event environment.
	public void configure() {
		if ( != null && .length() > 0) {
        }
		//creating the configuration will cause  
		// notification to listeners that the environment is ready
		.getInstance(KaEventConfiguration.class);
	}

Register provided events.
	private void registerEvents() {
		for (Key<?> bindingKey : .getBindings().keySet()) {
			if (bindingKey.getTypeLiteral().getRawType().equals(EventConfig.class)) {
				EventConfig event = (EventConfig.getInstance(bindingKey);
			}
		}
	}

Create instances of provided channels.
	private void createChannels() {
		for (Key<?> bindingKey : .getBindings().keySet()) {
			if (Channel.class.isAssignableFrom(bindingKey.getTypeLiteral().getRawType())) {
				.getInstance(bindingKey);
			}
		}
	}
New to GrepCode? Check out our FAQ X