Repository: incubator-rocketmq Updated Branches: refs/heads/spec 3735a3f4d -> d51ad8cca
[ROCKETMQ-17] Develop a vendor-neutral open standard for distributed messaging: add relay exception ASF JIRA: https://issues.apache.org/jira/browse/ROCKETMQ-17 Project: http://git-wip-us.apache.org/repos/asf/incubator-rocketmq/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-rocketmq/commit/d51ad8cc Tree: http://git-wip-us.apache.org/repos/asf/incubator-rocketmq/tree/d51ad8cc Diff: http://git-wip-us.apache.org/repos/asf/incubator-rocketmq/diff/d51ad8cc Branch: refs/heads/spec Commit: d51ad8cca19c469063fb2ac848a458e51272f32e Parents: 3735a3f Author: vintagewang <[email protected]> Authored: Fri Dec 30 17:08:48 2016 +0800 Committer: vintagewang <[email protected]> Committed: Fri Dec 30 17:08:48 2016 +0800 ---------------------------------------------------------------------- .../org/apache/openrelay/ServiceEndPoint.java | 9 ++-- .../openrelay/exception/OpenRelayException.java | 21 ++++++++ .../exception/OpenRelayRuntimeException.java | 21 ++++++++ .../openrelay/internal/DefaultKeyValue.java | 54 ++++++++++++++++++++ 4 files changed, 100 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-rocketmq/blob/d51ad8cc/spec/code/relay-user-level-api/java/src/main/java/org/apache/openrelay/ServiceEndPoint.java ---------------------------------------------------------------------- diff --git a/spec/code/relay-user-level-api/java/src/main/java/org/apache/openrelay/ServiceEndPoint.java b/spec/code/relay-user-level-api/java/src/main/java/org/apache/openrelay/ServiceEndPoint.java index f48f93e..fd4f4a4 100644 --- a/spec/code/relay-user-level-api/java/src/main/java/org/apache/openrelay/ServiceEndPoint.java +++ b/spec/code/relay-user-level-api/java/src/main/java/org/apache/openrelay/ServiceEndPoint.java @@ -16,7 +16,6 @@ */ package org.apache.openrelay; -import java.util.Properties; import org.apache.openrelay.observer.Observer; public interface ServiceEndPoint extends ServiceLifecycle { @@ -36,7 +35,7 @@ public interface ServiceEndPoint extends ServiceLifecycle { * @param properties the service published properties */ - void publish(Object service, Properties properties); + void publish(Object service, KeyValue properties); /** * Bind a service object to serviceEndPoint, which can directly call services provided by service object @@ -54,10 +53,10 @@ public interface ServiceEndPoint extends ServiceLifecycle { * @param <T> service proxy object to bind * @return service proxy object to bind */ - <T> T bind(Class<T> type, Properties properties); + <T> T bind(Class<T> type, KeyValue properties); /** - * Like {@link #bind(Class, Properties)} but specifying {@code serviceLoadBalance} that can be used to select + * Like {@link #bind(Class, KeyValue)} but specifying {@code serviceLoadBalance} that can be used to select * endPoint target * * @param type service type to bind in serviceConsumer @@ -66,7 +65,7 @@ public interface ServiceEndPoint extends ServiceLifecycle { * @param <T> service proxy object to bind * @return service proxy object to bind */ - <T> T bind(Class<T> type, Properties properties, ServiceLoadBalance serviceLoadBalance); + <T> T bind(Class<T> type, KeyValue properties, ServiceLoadBalance serviceLoadBalance); /** * Register an observer in an serviceEndPoint object. Whenever serviceEndPoint object publish or bind an service http://git-wip-us.apache.org/repos/asf/incubator-rocketmq/blob/d51ad8cc/spec/code/relay-user-level-api/java/src/main/java/org/apache/openrelay/exception/OpenRelayException.java ---------------------------------------------------------------------- diff --git a/spec/code/relay-user-level-api/java/src/main/java/org/apache/openrelay/exception/OpenRelayException.java b/spec/code/relay-user-level-api/java/src/main/java/org/apache/openrelay/exception/OpenRelayException.java new file mode 100644 index 0000000..fbefd69 --- /dev/null +++ b/spec/code/relay-user-level-api/java/src/main/java/org/apache/openrelay/exception/OpenRelayException.java @@ -0,0 +1,21 @@ +/* + * 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.openrelay.exception; + +public class OpenRelayException extends Exception { +} http://git-wip-us.apache.org/repos/asf/incubator-rocketmq/blob/d51ad8cc/spec/code/relay-user-level-api/java/src/main/java/org/apache/openrelay/exception/OpenRelayRuntimeException.java ---------------------------------------------------------------------- diff --git a/spec/code/relay-user-level-api/java/src/main/java/org/apache/openrelay/exception/OpenRelayRuntimeException.java b/spec/code/relay-user-level-api/java/src/main/java/org/apache/openrelay/exception/OpenRelayRuntimeException.java new file mode 100644 index 0000000..7b1109b --- /dev/null +++ b/spec/code/relay-user-level-api/java/src/main/java/org/apache/openrelay/exception/OpenRelayRuntimeException.java @@ -0,0 +1,21 @@ +/* + * 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.openrelay.exception; + +public class OpenRelayRuntimeException extends RuntimeException { +} http://git-wip-us.apache.org/repos/asf/incubator-rocketmq/blob/d51ad8cc/spec/code/relay-user-level-api/java/src/main/java/org/apache/openrelay/internal/DefaultKeyValue.java ---------------------------------------------------------------------- diff --git a/spec/code/relay-user-level-api/java/src/main/java/org/apache/openrelay/internal/DefaultKeyValue.java b/spec/code/relay-user-level-api/java/src/main/java/org/apache/openrelay/internal/DefaultKeyValue.java new file mode 100644 index 0000000..e63459a --- /dev/null +++ b/spec/code/relay-user-level-api/java/src/main/java/org/apache/openrelay/internal/DefaultKeyValue.java @@ -0,0 +1,54 @@ +/* + * 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.openrelay.internal; + +import org.apache.openrelay.KeyValue; + +public class DefaultKeyValue implements KeyValue { + @Override public KeyValue put(String key, int value) { + return null; + } + + @Override public KeyValue put(String key, long value) { + return null; + } + + @Override public KeyValue put(String key, double value) { + return null; + } + + @Override public KeyValue put(String key, String value) { + return null; + } + + @Override public int getInt(String key) { + return 0; + } + + @Override public long getLong(String key) { + return 0; + } + + @Override public double getDouble(String key) { + return 0; + } + + @Override public String getString(String key) { + return null; + } +}
