Repository: incubator-stratos Updated Branches: refs/heads/master 0bb15d182 -> 2e8e3033a
adding a interface to support other data publisher scenarios Project: http://git-wip-us.apache.org/repos/asf/incubator-stratos/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-stratos/commit/e308ae5d Tree: http://git-wip-us.apache.org/repos/asf/incubator-stratos/tree/e308ae5d Diff: http://git-wip-us.apache.org/repos/asf/incubator-stratos/diff/e308ae5d Branch: refs/heads/master Commit: e308ae5d4a5b4ca7627e10a5959f90590745d293 Parents: c271ce8 Author: Isuru <[email protected]> Authored: Mon Feb 17 19:41:02 2014 +0530 Committer: Isuru <[email protected]> Committed: Mon Feb 17 19:41:02 2014 +0530 ---------------------------------------------------------------------- .../agent/data/publisher/DataPublisher.java | 6 ++-- .../data/publisher/GenericDataPublisher.java | 29 ++++++++++++++++++++ 2 files changed, 32 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/e308ae5d/components/org.apache.stratos.cartridge.agent/src/main/java/org/apache/stratos/cartridge/agent/data/publisher/DataPublisher.java ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.cartridge.agent/src/main/java/org/apache/stratos/cartridge/agent/data/publisher/DataPublisher.java b/components/org.apache.stratos.cartridge.agent/src/main/java/org/apache/stratos/cartridge/agent/data/publisher/DataPublisher.java index 4601a74..727beb6 100644 --- a/components/org.apache.stratos.cartridge.agent/src/main/java/org/apache/stratos/cartridge/agent/data/publisher/DataPublisher.java +++ b/components/org.apache.stratos.cartridge.agent/src/main/java/org/apache/stratos/cartridge/agent/data/publisher/DataPublisher.java @@ -30,7 +30,7 @@ import org.wso2.carbon.databridge.commons.StreamDefinition; import java.util.Date; -public abstract class DataPublisher { +public abstract class DataPublisher implements GenericDataPublisher { private static final Log log = LogFactory.getLog(DataPublisher.class); @@ -65,7 +65,7 @@ public abstract class DataPublisher { log.info("DataPublisher initialized"); } - protected void publish (DataContext dataContext) { + public void publish (DataContext dataContext) { Event event = new Event(); event.setTimeStamp(new Date().getTime()); @@ -82,7 +82,7 @@ public abstract class DataPublisher { } } - protected void terminate () { + public void terminate () { dataPublisher.stop(); } http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/e308ae5d/components/org.apache.stratos.cartridge.agent/src/main/java/org/apache/stratos/cartridge/agent/data/publisher/GenericDataPublisher.java ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.cartridge.agent/src/main/java/org/apache/stratos/cartridge/agent/data/publisher/GenericDataPublisher.java b/components/org.apache.stratos.cartridge.agent/src/main/java/org/apache/stratos/cartridge/agent/data/publisher/GenericDataPublisher.java new file mode 100644 index 0000000..4f8dd44 --- /dev/null +++ b/components/org.apache.stratos.cartridge.agent/src/main/java/org/apache/stratos/cartridge/agent/data/publisher/GenericDataPublisher.java @@ -0,0 +1,29 @@ +package org.apache.stratos.cartridge.agent.data.publisher; + +/* + * 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. + */ + +public interface GenericDataPublisher { + + public void initialize (); + + public void publish (DataContext dataContext); + + public void terminate (); +}
