diff options
Diffstat (limited to 'controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/ControlLoopPublisher.java')
-rw-r--r-- | controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/ControlLoopPublisher.java | 42 |
1 files changed, 24 insertions, 18 deletions
diff --git a/controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/ControlLoopPublisher.java b/controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/ControlLoopPublisher.java index 3d31c413b..2b1fbefc7 100644 --- a/controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/ControlLoopPublisher.java +++ b/controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/ControlLoopPublisher.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * controlloop * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,21 +26,27 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; public interface ControlLoopPublisher { - - public void publish(Object object); - - public static class Factory { - private static final Logger logger = LoggerFactory.getLogger(Factory.class); - - - public ControlLoopPublisher buildLogger(String className) throws ControlLoopException { - try { - Constructor<?> constr = Class.forName(className).getConstructor(); - return (ControlLoopPublisher) constr.newInstance(); - } catch (Exception e) { - logger.error("ControlLoopPublisher.buildLogger threw: ", e); - throw new ControlLoopException("Cannot load class " + className + " as a control loop publisher"); - } - } - } + + public void publish(Object object); + + public static class Factory { + private static final Logger logger = LoggerFactory.getLogger(Factory.class); + + /** + * Construct an instance. + * + * @param className name of the class + * @return the instance + * @throws ControlLoopException if an error occurs + */ + public ControlLoopPublisher buildLogger(String className) throws ControlLoopException { + try { + Constructor<?> constr = Class.forName(className).getConstructor(); + return (ControlLoopPublisher) constr.newInstance(); + } catch (Exception e) { + logger.error("ControlLoopPublisher.buildLogger threw: ", e); + throw new ControlLoopException("Cannot load class " + className + " as a control loop publisher"); + } + } + } } |