fixed issue #5, added gradle build config
This commit is contained in:
parent
89f44544bd
commit
a47b632880
10
build.gradle
Normal file
10
build.gradle
Normal file
|
@ -0,0 +1,10 @@
|
|||
usePlugin('java')
|
||||
|
||||
group="org.mbassy"
|
||||
version="1.0.2.RC"
|
||||
|
||||
dependencies {
|
||||
addMavenRepo()
|
||||
|
||||
testCompile "junit:junit:4.10@jar"
|
||||
}
|
2
pom.xml
2
pom.xml
|
@ -4,7 +4,7 @@
|
|||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.mbassy</groupId>
|
||||
<artifactId>mbassador</artifactId>
|
||||
<version>1.0.1.RC</version>
|
||||
<version>1.0.2.RC</version>
|
||||
<packaging>jar</packaging>
|
||||
<name>mbassador</name>
|
||||
<description>Mbassador is a fast and flexible message bus system that follows the publish subscribe pattern
|
||||
|
|
|
@ -52,6 +52,27 @@ public abstract class AbstractMessageBus<T, P extends IMessageBus.IPostCommand>
|
|||
// it can be customized by implementing the getSubscriptionFactory() method
|
||||
private final SubscriptionFactory subscriptionFactory;
|
||||
|
||||
|
||||
|
||||
|
||||
public AbstractMessageBus() {
|
||||
this(2);
|
||||
}
|
||||
|
||||
public AbstractMessageBus(int dispatcherThreadCount) {
|
||||
this(dispatcherThreadCount, new ThreadPoolExecutor(5, 50, 1, TimeUnit.MINUTES, new LinkedBlockingQueue<Runnable>()));
|
||||
}
|
||||
|
||||
public AbstractMessageBus(int dispatcherThreadCount, ExecutorService executor) {
|
||||
this.executor = executor;
|
||||
initDispatcherThreads(dispatcherThreadCount > 0 ? dispatcherThreadCount : 2);
|
||||
addErrorHandler(new IPublicationErrorHandler.ConsoleLogger());
|
||||
subscriptionFactory = getSubscriptionFactory();
|
||||
}
|
||||
|
||||
// use this method to introduce a custom subscription factory for extension
|
||||
protected abstract SubscriptionFactory getSubscriptionFactory();
|
||||
|
||||
// initialize the dispatch workers
|
||||
private void initDispatcherThreads(int numberOfThreads) {
|
||||
for (int i = 0; i < numberOfThreads; i++) {
|
||||
|
@ -74,28 +95,6 @@ public abstract class AbstractMessageBus<T, P extends IMessageBus.IPostCommand>
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
public AbstractMessageBus() {
|
||||
this(2);
|
||||
}
|
||||
|
||||
public AbstractMessageBus(int dispatcherThreadCount) {
|
||||
this(2, new ThreadPoolExecutor(5, 50, 1, TimeUnit.MINUTES, new LinkedBlockingQueue<Runnable>()));
|
||||
}
|
||||
|
||||
public AbstractMessageBus(int dispatcherThreadCount, ExecutorService executor) {
|
||||
this.executor = executor;
|
||||
initDispatcherThreads(dispatcherThreadCount > 0 ? dispatcherThreadCount : 2);
|
||||
addErrorHandler(new IPublicationErrorHandler.ConsoleLogger());
|
||||
subscriptionFactory = getSubscriptionFactory();
|
||||
initialize();
|
||||
}
|
||||
|
||||
protected abstract SubscriptionFactory getSubscriptionFactory();
|
||||
|
||||
protected void initialize() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<IPublicationErrorHandler> getRegisteredErrorHandlers() {
|
||||
return Collections.unmodifiableCollection(errorHandlers);
|
||||
|
|
Loading…
Reference in New Issue
Block a user