Messaging facility initials for new architecture

This commit is contained in:
Kelven Yang 2012-08-28 17:55:01 -07:00
parent b65f9ec414
commit 2300310243
49 changed files with 321 additions and 47 deletions

View File

@ -1,3 +1,3 @@
#Thu Aug 23 12:18:20 PDT 2012
#Mon Aug 27 14:48:10 PDT 2012
eclipse.preferences.version=1
encoding/<project>=UTF-8

View File

@ -1,3 +1,3 @@
#Thu Aug 23 12:18:28 PDT 2012
#Mon Aug 27 14:48:15 PDT 2012
eclipse.preferences.version=1
encoding/<project>=UTF-8

View File

@ -1,3 +1,3 @@
#Thu Aug 23 12:18:25 PDT 2012
#Mon Aug 27 14:48:15 PDT 2012
eclipse.preferences.version=1
encoding/<project>=UTF-8

View File

@ -1,3 +1,3 @@
#Thu Aug 23 12:18:35 PDT 2012
#Mon Aug 27 14:48:16 PDT 2012
eclipse.preferences.version=1
encoding/<project>=UTF-8

View File

@ -1,3 +1,3 @@
#Thu Aug 23 12:18:30 PDT 2012
#Mon Aug 27 14:48:15 PDT 2012
eclipse.preferences.version=1
encoding/<project>=UTF-8

View File

@ -1,3 +1,3 @@
#Thu Aug 23 12:18:26 PDT 2012
#Mon Aug 27 14:48:15 PDT 2012
eclipse.preferences.version=1
encoding/<project>=UTF-8

View File

@ -1,3 +1,3 @@
#Thu Aug 23 12:18:25 PDT 2012
#Mon Aug 27 14:48:16 PDT 2012
eclipse.preferences.version=1
encoding/<project>=UTF-8

View File

@ -1,6 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
<classpathentry kind="output" path="bin"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>

View File

@ -10,8 +10,14 @@
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

View File

@ -1,11 +1,13 @@
#Mon Aug 27 14:50:14 PDT 2012
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.compliance=1.5
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.7
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.source=1.5

View File

@ -3,4 +3,11 @@
<groupId>cloudstack</groupId>
<artifactId>cloud-framework-ipc</artifactId>
<version>0.0.1-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>org.hornetq</groupId>
<artifactId>hornetq-core-client</artifactId>
<version>snap-r9548</version>
</dependency>
</dependencies>
</project>

View File

@ -18,6 +18,8 @@
*/
package org.apache.cloudstack.framework.ipc;
import org.apache.cloudstack.framework.messaging.Message;
/**
* Event subscriber interface
*

View File

@ -16,11 +16,14 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.cloudstack.framework.ipc;
import java.util.Map;
package org.apache.cloudstack.framework.messaging;
public interface Message {
String getTopic();
Map<String, Object> getContent();
String getTitle();
String getContent();
String getPublisherTag();
long getSendTime();
long getReceiveTime();
}

View File

@ -0,0 +1,30 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.cloudstack.framework.messaging;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface MessageHandler {
String messageTitle();
}

View File

@ -16,9 +16,13 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.cloudstack.framework.ipc;
package org.apache.cloudstack.framework.messaging;
import org.apache.cloudstack.framework.ipc.Publisher;
import org.apache.cloudstack.framework.ipc.Subscriber;
public interface MessageSystem {
/**
* Creates the publisher
* @param name of the publisher

View File

@ -0,0 +1,24 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.cloudstack.framework.messaging;
public interface MessagingDeliveryListener {
void onAcknowledge(String topicChannel, Message message);
void onTimeout(String topicChannel, Message message);
}

View File

@ -0,0 +1,24 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.cloudstack.framework.messaging;
public enum MessagingDeliveryStrategy {
atMostOneCasting,
blindCasting
}

View File

@ -0,0 +1,32 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.cloudstack.framework.messaging;
public interface MessagingProvider {
void createChanel(String topic, MessagingDeliveryStrategy deliveryStrategy);
void pulishMessage(String topic, Message message);
void publishCertifiedMessage(String topic, Message message,
int retryIntervalMillis, int timeoutMillis,
MessagingDeliveryListener deliveryListener);
void subscribe(String topicChannel, String messageTitle, MessagingSubscriber subscriber);
void unsubscribe(String topicChannel, String messageTitle, MessagingSubscriber subscriber);
}

View File

@ -0,0 +1,23 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.cloudstack.framework.messaging;
public interface MessagingSubscriber {
void onMessage(String topic, Message message);
}

View File

@ -0,0 +1,27 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.cloudstack.framework.messaging;
public class SubscriberDelegate implements MessagingSubscriber {
public void onMessage(String topic, Message message) {
// ???
}
}

View File

@ -0,0 +1,58 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.cloudstack.framework.messaging.hornetq;
import org.apache.cloudstack.framework.messaging.Message;
import org.apache.cloudstack.framework.messaging.MessagingDeliveryListener;
import org.apache.cloudstack.framework.messaging.MessagingDeliveryStrategy;
import org.apache.cloudstack.framework.messaging.MessagingProvider;
import org.apache.cloudstack.framework.messaging.MessagingSubscriber;
public class EmbeddedMessagingProvider implements MessagingProvider {
public void createChanel(String topic,
MessagingDeliveryStrategy deliveryStrategy) {
// TODO Auto-generated method stub
}
public void pulishMessage(String topic, Message message) {
// TODO Auto-generated method stub
}
public void publishCertifiedMessage(String topic, Message message,
int retryIntervalMillis, int timeoutMillis,
MessagingDeliveryListener deliveryListener) {
// TODO Auto-generated method stub
}
public void subscribe(String topicChannel, String messageTitle,
MessagingSubscriber subscriber) {
// TODO Auto-generated method stub
}
public void unsubscribe(String topicChannel, String messageTitle,
MessagingSubscriber subscriber) {
// TODO Auto-generated method stub
}
}

View File

@ -1,3 +1,3 @@
#Thu Aug 23 12:18:20 PDT 2012
#Mon Aug 27 14:48:15 PDT 2012
eclipse.preferences.version=1
encoding/<project>=UTF-8

View File

@ -1,7 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry combineaccessrules="false" kind="src" path="/framework-ipc"/>
<classpathentry kind="output" path="bin"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>

View File

@ -10,8 +10,14 @@
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

View File

@ -2,7 +2,15 @@
<classpath>
<classpathentry kind="src" output="target/classes" path="src/"/>
<classpathentry kind="src" output="target/test-classes" path="test"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>

View File

@ -1,3 +1,3 @@
#Thu Aug 23 12:18:31 PDT 2012
#Mon Aug 27 14:48:16 PDT 2012
eclipse.preferences.version=1
encoding/<project>=UTF-8

View File

@ -1,3 +1,3 @@
#Thu Aug 23 12:18:31 PDT 2012
#Mon Aug 27 14:48:16 PDT 2012
eclipse.preferences.version=1
encoding/<project>=UTF-8

View File

@ -1,3 +1,3 @@
#Thu Aug 23 12:18:36 PDT 2012
#Mon Aug 27 14:48:16 PDT 2012
eclipse.preferences.version=1
encoding/<project>=UTF-8

View File

@ -1,3 +1,3 @@
#Thu Aug 23 12:18:35 PDT 2012
#Mon Aug 27 14:48:16 PDT 2012
eclipse.preferences.version=1
encoding/<project>=UTF-8

View File

@ -1,3 +1,3 @@
#Thu Aug 23 12:18:30 PDT 2012
#Mon Aug 27 14:48:16 PDT 2012
eclipse.preferences.version=1
encoding/<project>=UTF-8

View File

@ -1,3 +1,3 @@
#Thu Aug 23 12:18:37 PDT 2012
#Mon Aug 27 14:48:16 PDT 2012
eclipse.preferences.version=1
encoding/<project>=UTF-8

View File

@ -1,3 +1,3 @@
#Thu Aug 23 12:18:36 PDT 2012
#Mon Aug 27 14:48:16 PDT 2012
eclipse.preferences.version=1
encoding/<project>=UTF-8

View File

@ -1,3 +1,3 @@
#Thu Aug 23 12:18:34 PDT 2012
#Mon Aug 27 14:48:16 PDT 2012
eclipse.preferences.version=1
encoding/<project>=UTF-8

View File

@ -1,3 +1,3 @@
#Thu Aug 23 12:18:37 PDT 2012
#Mon Aug 27 14:48:16 PDT 2012
eclipse.preferences.version=1
encoding/<project>=UTF-8

View File

@ -1,3 +1,3 @@
#Thu Aug 23 12:18:35 PDT 2012
#Mon Aug 27 14:48:16 PDT 2012
eclipse.preferences.version=1
encoding/<project>=UTF-8

View File

@ -1,3 +1,3 @@
#Thu Aug 23 12:18:29 PDT 2012
#Mon Aug 27 14:48:16 PDT 2012
eclipse.preferences.version=1
encoding/<project>=UTF-8

View File

@ -1,3 +1,3 @@
#Thu Aug 23 12:18:36 PDT 2012
#Mon Aug 27 14:48:16 PDT 2012
eclipse.preferences.version=1
encoding/<project>=UTF-8

View File

@ -1,3 +1,3 @@
#Thu Aug 23 12:18:31 PDT 2012
#Mon Aug 27 14:48:16 PDT 2012
eclipse.preferences.version=1
encoding/<project>=UTF-8

View File

@ -1,3 +1,3 @@
#Thu Aug 23 12:18:34 PDT 2012
#Mon Aug 27 14:48:16 PDT 2012
eclipse.preferences.version=1
encoding/<project>=UTF-8

View File

@ -1,3 +1,3 @@
#Thu Aug 23 12:18:33 PDT 2012
#Mon Aug 27 14:48:16 PDT 2012
eclipse.preferences.version=1
encoding/<project>=UTF-8

View File

@ -1,3 +1,3 @@
#Thu Aug 23 12:18:29 PDT 2012
#Mon Aug 27 14:48:16 PDT 2012
eclipse.preferences.version=1
encoding/<project>=UTF-8

View File

@ -1,3 +1,3 @@
#Thu Aug 23 12:18:32 PDT 2012
#Mon Aug 27 14:48:16 PDT 2012
eclipse.preferences.version=1
encoding/<project>=UTF-8

View File

@ -1,3 +1,3 @@
#Thu Aug 23 12:18:29 PDT 2012
#Mon Aug 27 14:48:16 PDT 2012
eclipse.preferences.version=1
encoding/<project>=UTF-8

View File

@ -1,3 +1,3 @@
#Thu Aug 23 12:18:38 PDT 2012
#Mon Aug 27 14:48:16 PDT 2012
eclipse.preferences.version=1
encoding/<project>=UTF-8

View File

@ -1,3 +1,3 @@
#Thu Aug 23 12:18:37 PDT 2012
#Mon Aug 27 14:48:16 PDT 2012
eclipse.preferences.version=1
encoding/<project>=UTF-8

View File

@ -1,3 +1,3 @@
#Thu Aug 23 12:18:29 PDT 2012
#Mon Aug 27 14:48:15 PDT 2012
eclipse.preferences.version=1
encoding/<project>=UTF-8

View File

@ -1,3 +1,3 @@
#Thu Aug 23 12:18:36 PDT 2012
#Mon Aug 27 14:48:15 PDT 2012
eclipse.preferences.version=1
encoding/<project>=UTF-8

View File

@ -1,3 +1,3 @@
#Thu Aug 23 12:18:21 PDT 2012
#Mon Aug 27 14:48:16 PDT 2012
eclipse.preferences.version=1
encoding/<project>=UTF-8

View File

@ -1,3 +1,3 @@
#Thu Aug 23 12:18:26 PDT 2012
#Mon Aug 27 14:48:16 PDT 2012
eclipse.preferences.version=1
encoding/<project>=UTF-8