/*
* Copyright (C) 2012 Glencoe Software, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package ome.services.blitz.impl.commands;
import java.util.HashMap;
import java.util.Map;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import ome.system.OmeroContext;
/**
* Types which rely on the omero.model and omero.api objects rather than just
* the omero.cmd types. These are typically intended as replacements for the
* API method calls provided by ome.services.blitz.impl servants.
*/
public class RequestObjectFactoryRegistry extends
omero.util.ObjectFactoryRegistry implements ApplicationContextAware {
private/* final */OmeroContext ctx;
public void setApplicationContext(ApplicationContext ctx)
throws BeansException {
this.ctx = (OmeroContext) ctx;
}
public Map<String, ObjectFactory> createFactories(Ice.Communicator ic) {
Map<String, ObjectFactory> factories = new HashMap<String, ObjectFactory>();
factories.put(SaveI.ice_staticId(), new ObjectFactory(
SaveI.ice_staticId()) {
@Override
public Ice.Object create(String name) {
return new SaveI();
}
});
return factories;
}
}