/**
* Copyright (C) 2010 Andrew C. Love <drewncrew@gmail.com>
*
* Licensed 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 com.dnc.cloak.hood;
import org.apache.log4j.Logger;
import com.dnc.cloak.framework.config.ConfigurationMgr;
import com.dnc.cloak.framework.context.IContext;
import com.dnc.cloak.framework.model.IModel;
import com.dnc.cloak.hood.annotation.ServiceMethod;
import com.dnc.cloak.hood.integration.IServiceActivator;
public class SimpleServiceActivator implements IServiceActivator {
private static final Logger logger = Logger.getLogger(SimpleServiceActivator.class.getName());
@Override
public String getID() {
return "SimpleServiceActivatorID";
}
@ServiceMethod(serviceMethod="read", sequence=2)
public IModel read(IContext context, IModel model) {
ConfigurationMgr.getInstance().getProperty("root.connection", "user", "none");
logger.info("In the read serviceActivator method");
logger.info("model:"+model);
return model;
}
@ServiceMethod(serviceMethod="create", sequence=0)
public void create(IContext context, IModel model){
logger.info("In the create serviceActivator method");
logger.info("model:"+ model.getID());
}
@ServiceMethod(serviceMethod="update")
public void update(IContext context, IModel model) {
logger.info("In the update serviceActivator method");
logger.info("model:"+model);
}
@ServiceMethod(serviceMethod="delete")
public void delete(IContext context, IModel model) {
logger.info("In the delete serviceActivator method");
logger.info("model:"+model);
}
}
|