Changeset 1362
- Timestamp:
- 03/14/07 07:45:37 (21 months ago)
- Location:
- trunk/components
- Files:
-
- 8 added
- 9 modified
-
blitz/resources/slice/API.ice (modified) (13 diffs)
-
blitz/resources/slice/Error.ice (modified) (2 diffs)
-
blitz/src/cpp/OMERO/client.cpp (modified) (2 diffs)
-
blitz/src/cpp/OMERO/client.h (modified) (1 diff)
-
blitz/src/ome/services/icy/fire/SessionManagerI.java (modified) (6 diffs)
-
blitz/src/ome/services/icy/impl/ServiceFactoryI.java (modified) (7 diffs)
-
blitz/src/ome/services/icy/util/AbstractSessionMessage.java (added)
-
blitz/src/ome/services/icy/util/CreateSessionMessage.java (added)
-
blitz/src/ome/services/icy/util/DestroySessionMessage.java (added)
-
blitz/src/ome/services/icy/util/ServantDefinition.java (added)
-
blitz/src/ome/services/icy/util/UnregisterServantMessage.java (modified) (4 diffs)
-
tools/licenses/.classpath (modified) (1 diff)
-
tools/licenses/classpath.xml (modified) (4 diffs)
-
tools/licenses/resources/ome/services/blitz-ome.services.licenses.ILicense.xml (added)
-
tools/licenses/resources/slice (added)
-
tools/licenses/resources/slice/LicensesAPI.ice (added)
-
tools/licenses/src/ome/services/licenses/LicenseSessionListener.java (added)
Legend:
- Unmodified
- Added
- Removed
-
trunk/components/blitz/resources/slice/API.ice
r1351 r1362 38 38 sequence<string> StringSet; 39 39 40 interface IAdmin 40 interface ServiceInterface 41 { 42 }; 43 44 interface IAdmin extends ServiceInterface 41 45 { 42 46 … … 82 86 }; 83 87 84 interface IConfig 88 interface IConfig extends ServiceInterface 85 89 { 86 90 nonmutating string getVersion() throws ServerError; … … 92 96 93 97 94 interface IPixels 98 interface IPixels extends ServiceInterface 95 99 { 96 100 nonmutating omero::model::Pixels retrievePixDescription(long pixId) throws ServerError; … … 106 110 dictionary<int, int> CountMap; 107 111 108 interface IPojos 112 interface IPojos extends ServiceInterface 109 113 { 110 114 nonmutating IObjectList loadContainerHierarchy(string rootType, omero::api::LongList rootIds, omero::sys::ParamMap options) throws ServerError; … … 127 131 }; 128 132 129 interface IQuery 133 interface IQuery extends ServiceInterface 130 134 { 131 135 nonmutating omero::model::IObject get(string klass, long id) throws ServerError; … … 141 145 }; 142 146 143 interface ITypes 147 interface ITypes extends ServiceInterface 144 148 { 145 149 omero::model::IObject createEnumeration(omero::model::IObject newEnum) throws ServerError; … … 148 152 }; 149 153 150 interface IUpdate 154 interface IUpdate extends ServiceInterface 151 155 { 152 156 void saveObject(omero::model::IObject obj) throws ServerError; … … 157 161 }; 158 162 159 interface RawFileStore 163 interface RawFileStore extends ServiceInterface 160 164 { 161 165 void setFileId(long fileId) throws ServerError; … … 164 168 }; 165 169 166 interface RawPixelsStore 170 interface RawPixelsStore extends ServiceInterface 167 171 { 168 172 void setPixelsId(long pixelsId) throws ServerError; … … 189 193 }; 190 194 191 interface RenderingEngine 195 interface RenderingEngine extends ServiceInterface 192 196 { 193 197 omero::romio::RGBBuffer render(omero::romio::PlaneDef def) throws ServerError; … … 227 231 }; 228 232 229 interface ThumbnailStore 233 interface ThumbnailStore extends ServiceInterface 230 234 { 231 235 void setPixelsId(long pixelsId) throws ServerError; … … 240 244 }; 241 245 242 interface SimpleCallback { 246 interface SimpleCallback 247 { 243 248 void call(); 244 249 }; … … 260 265 ThumbnailStore* createThumbnailStore(); 261 266 267 ServiceInterface* getByName(string name) throws ServerError; 262 268 void setCallback(SimpleCallback* callback); 263 269 void close(); -
trunk/components/blitz/resources/slice/Error.ice
r1303 r1362 10 10 #define OMERO_ERROR_ICE 11 11 12 #include <Glacier2/Session.ice> 13 12 14 module omero 13 15 { … … 17 19 string serverExceptionClass; 18 20 string message; 21 }; 22 23 exception SessionCreationException extends Glacier2::CannotCreateSessionException 24 { 19 25 }; 20 26 -
trunk/components/blitz/src/cpp/OMERO/client.cpp
r1352 r1362 39 39 Glacier2::RouterPrx router = Glacier2::RouterPrx::checkedCast(prx); 40 40 Glacier2::SessionPrx session; 41 try 42 { 43 session = router->createSession(username, password); 44 } 45 catch(const Glacier2::PermissionDeniedException& ex) 46 { 47 cout << "permission denied:\n" << ex.reason << endl; 48 } 49 catch(const Glacier2::CannotCreateSessionException& ex) 50 { 51 cout << "cannot create session:\n" << ex.reason << endl; 52 } 41 session = router->createSession(username, password); 53 42 sf = omero::api::ServiceFactoryPrx::checkedCast(session); 54 43 55 44 } 56 45 … … 99 88 } 100 89 90 Ice::ObjectPrx client::getByName(const string& name, const ::Ice::Context& ctx) { 91 return sf->getByName(name, ctx); 92 } 93 101 94 void client::setCallback(const ::omero::api::SimpleCallbackPrx& cb, const ::Ice::Context& ctx) { 102 95 sf->setCallback(cb, ctx); -
trunk/components/blitz/src/cpp/OMERO/client.h
r1352 r1362 74 74 omero::api::RenderingEnginePrx createRenderingEngine(const ::Ice::Context& ctx); 75 75 omero::api::ThumbnailStorePrx createThumbnailStore(const ::Ice::Context& ctx); 76 Ice::ObjectPrx getByName(const std::string& name, const ::Ice::Context& ctx); 77 76 78 /* 77 79 * Closes the session AND all proxies created by it. -
trunk/components/blitz/src/ome/services/icy/fire/SessionManagerI.java
r1311 r1362 9 9 10 10 import java.util.List; 11 import java.util.Map; 11 12 13 import ome.conditions.InternalException; 12 14 import ome.logic.HardWiredInterceptor; 13 15 import ome.security.SecuritySystem; 16 import ome.services.icy.config.IceFacetFactoryBean; 17 import ome.services.icy.util.CreateSessionMessage; 14 18 import ome.system.OmeroContext; 15 19 import ome.system.Principal; 16 20 import ome.system.Roles; 21 import ome.util.messages.MessageException; 17 22 import omero.constants.EVENT; 18 23 import omero.constants.GROUP; … … 21 26 import org.apache.commons.logging.LogFactory; 22 27 import org.springframework.beans.BeansException; 28 import org.springframework.beans.factory.BeanFactoryUtils; 23 29 import org.springframework.context.ApplicationContext; 24 30 import org.springframework.context.ApplicationContextAware; 31 32 import Glacier2.CannotCreateSessionException; 25 33 26 34 public final class SessionManagerI extends Glacier2._SessionManagerDisp … … 46 54 } 47 55 } 56 48 57 } 49 58 … … 54 63 55 64 public Glacier2.SessionPrx create(String userId, 56 Glacier2.SessionControlPrx control, Ice.Current current) { 65 Glacier2.SessionControlPrx control, Ice.Current current) 66 throws CannotCreateSessionException { 57 67 58 68 Roles roles = securitySystem.getSecurityRoles(); … … 72 82 session.setInterceptors(CPTORS); 73 83 84 Ice.Identity id = new Ice.Identity(); 85 id.category = ""; 86 id.name = Ice.Util.generateUUID(); 87 Ice.ObjectPrx _prx = current.adapter.add(session,id); 88 Glacier2.SessionPrx prx = Glacier2.SessionPrxHelper.uncheckedCast(_prx); 89 74 90 if (log.isDebugEnabled()) { 75 91 log.debug(String.format("Created session %s for user %s", session, … … 77 93 } 78 94 79 return Glacier2.SessionPrxHelper.uncheckedCast(current.adapter 80 .addWithUUID(session)); 95 CreateSessionMessage msg = new CreateSessionMessage(this,id.name,principal); 96 try { 97 context.publishMessage(msg); 98 } catch (CannotCreateSessionException ccse) { 99 throw ccse; 100 } catch (Throwable t) { 101 // FIXME this copying should be a part of ome.conditions.* 102 InternalException ie = new InternalException(t.getMessage()); 103 ie.setStackTrace(t.getStackTrace()); 104 throw ie; 105 } 106 return prx; 81 107 } 82 108 -
trunk/components/blitz/src/ome/services/icy/impl/ServiceFactoryI.java
r1306 r1362 8 8 package ome.services.icy.impl; 9 9 10 import java.lang.reflect.Constructor; 11 import java.lang.reflect.InvocationTargetException; 10 12 import java.util.Collections; 11 13 import java.util.HashSet; … … 26 28 import ome.api.ServiceInterface; 27 29 import ome.api.ThumbnailStore; 30 import ome.conditions.InternalException; 28 31 import ome.logic.HardWiredInterceptor; 29 32 import ome.services.icy.fire.AopContextInitializer; 30 33 import ome.services.icy.fire.Session; 34 import ome.services.icy.util.DestroySessionMessage; 35 import ome.services.icy.util.ServantDefinition; 31 36 import ome.services.icy.util.ServantHelper; 32 37 import ome.services.icy.util.UnregisterServantMessage; … … 35 40 import ome.system.ServiceFactory; 36 41 import omeis.providers.re.RenderingEngine; 42 import omero.ServerError; 37 43 import omero.api.IAdminPrx; 38 44 import omero.api.IAdminPrxHelper; … … 53 59 import omero.api.RenderingEnginePrx; 54 60 import omero.api.RenderingEnginePrxHelper; 61 import omero.api.ServiceInterfacePrx; 62 import omero.api.ServiceInterfacePrxHelper; 55 63 import omero.api.SimpleCallbackPrx; 56 64 import omero.api.ThumbnailStorePrx; … … 85 93 import org.springframework.aop.framework.ProxyFactory; 86 94 import org.springframework.beans.BeansException; 95 import org.springframework.beans.factory.BeanFactoryUtils; 87 96 import org.springframework.context.ApplicationContext; 88 97 import org.springframework.context.ApplicationContextAware; 89 98 import org.springframework.context.ApplicationEvent; 90 99 import org.springframework.context.ApplicationListener; 100 101 import Ice.Current; 102 import Ice.ObjectPrx; 91 103 92 104 /** … … 325 337 // ========================================================================= 326 338 339 public ServiceInterfacePrx getByName(String name, Current current) throws ServerError { 340 Ice.Identity id = getIdentity(current, name); 341 String key = Ice.Util.identityToString(id); 342 343 Ice.ObjectPrx prx = servantProxy(id, current); 344 if (prx == null) { 345 ServantDefinition sd = (ServantDefinition) context.getBean(name); 346 Object servant; 347 try { 348 Object ops = createServantDelegate(sd.getOperationsClass(), sd 349 .getServiceClass(), key); 350 Constructor ctor = sd.getTieClass().getConstructor( 351 sd.getOperationsClass()); 352 servant = ctor.newInstance(ops); 353 prx = registerServant(sd.getOperationsClass().cast(servant), current, id); 354 } catch (Exception e) { 355 // FIXME 356 omero.InternalException ie = new omero.InternalException(); 357 ie.message = e.getMessage(); 358 throw ie; 359 } 360 } 361 return ServiceInterfacePrxHelper.uncheckedCast(prx); 362 } 363 327 364 public void setCallback(SimpleCallbackPrx callback, Ice.Current current) { 328 365 throw new UnsupportedOperationException(); … … 344 381 } 345 382 close(current); 383 DestroySessionMessage msg = new DestroySessionMessage(this,current.id.name,principal); 384 try { 385 context.publishMessage(msg); 386 } catch (Throwable t) { 387 // FIXME 388 InternalException ie = new InternalException(t.getMessage()); 389 ie.setStackTrace(t.getStackTrace()); 390 } 346 391 } 347 392 -
trunk/components/blitz/src/ome/services/icy/util/UnregisterServantMessage.java
r1304 r1362 1 /* 2 * $Id$ 3 * 4 * Copyright (c) 2007 Glencoe Software Inc. All rights reserved. 5 * Use is subject to license terms supplied in LICENSE.txt 6 */ 7 1 8 package ome.services.icy.util; 2 9 … … 13 20 import ome.system.OmeroContext; 14 21 import ome.util.Filterable; 22 import ome.util.messages.InternalMessage; 15 23 import omero.RType; 16 24 import omero.ServerError; … … 20 28 21 29 /** 22 * Provides helper methods so that servant implementations need not extend a23 * particular {@link Class}.24 *25 30 * @author josh 26 31 * 27 32 */ 28 public class UnregisterServantMessage extends ApplicationEvent { 33 public class UnregisterServantMessage extends InternalMessage { 34 35 private static final long serialVersionUID = 3409582093802L; 29 36 30 37 String key; … … 33 40 public UnregisterServantMessage(Object source, String serviceKey, Ice.Current current) { 34 41 super(source); 35 this.key = key;42 this.key = serviceKey; 36 43 this.curr = current; 37 44 } -
trunk/components/tools/licenses/.classpath
r1298 r1362 41 41 <classpathentry exported="true" kind="var" path="M2_REPO/omero/romio/3.0-TRUNK/romio-3.0-TRUNK.jar"/> 42 42 <classpathentry exported="true" kind="var" path="M2_REPO/omero/server/3.0-TRUNK/server-3.0-TRUNK.jar"/> 43 <classpathentry exported="true" kind="var" path="M2_REPO/omero/blitz/3.0-TRUNK/blitz-3.0-TRUNK.jar"/> 44 <classpathentry exported="true" kind="var" path="M2_REPO/omero/ice/3.1.1/ice-3.1.1.jar"/> 43 45 <classpathentry exported="true" kind="var" path="M2_REPO/omero/client/3.0-TRUNK/client-3.0-TRUNK.jar"/> 44 46 <classpathentry exported="true" kind="var" path="M2_REPO/org/acegisecurity/acegi-security/1.0.0-RC1/acegi-security-1.0.0-RC1.jar"/> -
trunk/components/tools/licenses/classpath.xml
r1298 r1362 59 59 <file name="omero/romio/3.0-TRUNK/romio-3.0-TRUNK.jar"/> 60 60 <file name="omero/server/3.0-TRUNK/server-3.0-TRUNK.jar"/> 61 <file name="omero/blitz/3.0-TRUNK/blitz-3.0-TRUNK.jar"/> 62 <file name="omero/ice/3.1.1/ice-3.1.1.jar"/> 61 63 <file name="omero/client/3.0-TRUNK/client-3.0-TRUNK.jar"/> 62 64 <file name="org/acegisecurity/acegi-security/1.0.0-RC1/acegi-security-1.0.0-RC1.jar"/> … … 103 105 <include name="omero/romio/3.0-TRUNK/romio-3.0-TRUNK.jar"/> 104 106 <include name="omero/server/3.0-TRUNK/server-3.0-TRUNK.jar"/> 107 <include name="omero/blitz/3.0-TRUNK/blitz-3.0-TRUNK.jar"/> 108 <include name="omero/ice/3.1.1/ice-3.1.1.jar"/> 105 109 <include name="omero/client/3.0-TRUNK/client-3.0-TRUNK.jar"/> 106 110 <include name="org/acegisecurity/acegi-security/1.0.0-RC1/acegi-security-1.0.0-RC1.jar"/> … … 150 154 <file name="omero/romio/3.0-TRUNK/romio-3.0-TRUNK.jar"/> 151 155 <file name="omero/server/3.0-TRUNK/server-3.0-TRUNK.jar"/> 156 <file name="omero/blitz/3.0-TRUNK/blitz-3.0-TRUNK.jar"/> 157 <file name="omero/ice/3.1.1/ice-3.1.1.jar"/> 152 158 <file name="omero/client/3.0-TRUNK/client-3.0-TRUNK.jar"/> 153 159 <file name="org/acegisecurity/acegi-security/1.0.0-RC1/acegi-security-1.0.0-RC1.jar"/> … … 199 205 <include name="omero/romio/3.0-TRUNK/romio-3.0-TRUNK.jar"/> 200 206 <include name="omero/server/3.0-TRUNK/server-3.0-TRUNK.jar"/> 207 <include name="omero/blitz/3.0-TRUNK/blitz-3.0-TRUNK.jar"/> 208 <include name="omero/ice/3.1.1/ice-3.1.1.jar"/> 201 209 <include name="omero/client/3.0-TRUNK/client-3.0-TRUNK.jar"/> 202 210 <include name="org/acegisecurity/acegi-security/1.0.0-RC1/acegi-security-1.0.0-RC1.jar"/>
