Package org.orgama.server.handler

Source Code of org.orgama.server.handler.GetInstanceHandler

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.orgama.server.handler;

import com.google.inject.Inject;
import com.gwtplatform.dispatch.server.ExecutionContext;
import org.orgama.server.SimpleDataServices;
import org.orgama.shared.action.GetInstance;
import org.orgama.shared.action.GetInstanceResult;

   
/**
* Handles getting single instances
* @author kguthrie
*/
public class GetInstanceHandler
        extends AbstractHandler<GetInstance,
                GetInstanceResult> {

    @Inject
    public GetInstanceHandler(SimpleDataServices services) {
       
    }
   
    @Override
    public GetInstanceResult execImpl(GetInstance a,
            ExecutionContext ec) {
        return new GetInstanceResult(SimpleDataServices.get(
                a.getClassType(), a.getKey()));
    }

    @Override
    public void undoImpl(GetInstance a, GetInstanceResult r,
            ExecutionContext ec) {
        //Nothing to do here
    }

    @Override
    public Class<GetInstance> getActionType() {
        return GetInstance.class;
    }

}
TOP

Related Classes of org.orgama.server.handler.GetInstanceHandler

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.