summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Liebig2008-04-02 08:26:20 (EDT)
committerStefan Liebig2008-04-02 08:26:20 (EDT)
commitd43327114f5d5883460dbfaeed7e9930ec1edd79 (patch)
treeced26f18b01a05ad41da667339051b2985799c15
parent09af3f878ece3d4ada265532781d21b18b93bece (diff)
downloadorg.eclipse.riena-d43327114f5d5883460dbfaeed7e9930ec1edd79.zip
org.eclipse.riena-d43327114f5d5883460dbfaeed7e9930ec1edd79.tar.gz
org.eclipse.riena-d43327114f5d5883460dbfaeed7e9930ec1edd79.tar.bz2
refactoring: remove service ID field from interfaces
-rw-r--r--org.eclipse.riena.communication.console/src/org/eclipse/riena/internal/communication/console/Activator.java7
-rw-r--r--org.eclipse.riena.communication.core/src/org/eclipse/riena/communication/core/IRemoteServiceRegistry.java108
-rw-r--r--org.eclipse.riena.communication.core/src/org/eclipse/riena/communication/core/factory/IRemoteServiceFactory.java41
-rw-r--r--org.eclipse.riena.communication.core/src/org/eclipse/riena/communication/core/factory/RemoteServiceFactory.java4
-rw-r--r--org.eclipse.riena.communication.core/src/org/eclipse/riena/communication/core/hooks/ICallHook.java2
-rw-r--r--org.eclipse.riena.communication.core/src/org/eclipse/riena/communication/core/hooks/IServiceHook.java2
-rw-r--r--org.eclipse.riena.communication.core/src/org/eclipse/riena/communication/core/publisher/IServicePublishEventDispatcher.java21
-rw-r--r--org.eclipse.riena.communication.core/src/org/eclipse/riena/communication/core/publisher/IServicePublisher.java23
-rw-r--r--org.eclipse.riena.communication.core/src/org/eclipse/riena/internal/communication/core/Activator.java5
-rw-r--r--org.eclipse.riena.communication.core/src/org/eclipse/riena/internal/communication/core/factory/CallHooksProxy.java2
-rw-r--r--org.eclipse.riena.communication.factory.hessian/src/org/eclipse/riena/internal/communication/factory/hessian/Activator.java2
-rw-r--r--org.eclipse.riena.communication.publisher.hessian/src/org/eclipse/riena/internal/communication/publisher/hessian/Activator.java2
-rw-r--r--org.eclipse.riena.communication.publisher/src/org/eclipse/riena/internal/communication/publisher/Activator.java7
-rw-r--r--org.eclipse.riena.communication.publisher/src/org/eclipse/riena/internal/communication/publisher/ServiceHooksProxy.java2
-rw-r--r--org.eclipse.riena.communication.sample.pingpong.client/src/org/eclipse/riena/internal/communication/sample/pingpong/client/Activator.java64
-rw-r--r--org.eclipse.riena.communication.sample.pingpong.common/src/org/eclipse/riena/communication/sample/pingpong/common/IPingPong.java19
-rw-r--r--org.eclipse.riena.communication.sample.pingpong.server/src/org/eclipse/riena/internal/communication/sample/pingpong/server/Activator.java2
-rw-r--r--org.eclipse.riena.core/src/org/eclipse/riena/core/cache/IGenericObjectCache.java2
-rw-r--r--org.eclipse.riena.core/src/org/eclipse/riena/core/exception/IExceptionHandler.java112
-rw-r--r--org.eclipse.riena.core/src/org/eclipse/riena/core/exception/IExceptionHandlerManager.java174
-rw-r--r--org.eclipse.riena.sample.app.common/src/org/eclipse/riena/sample/app/common/model/ICustomerSearch.java2
-rw-r--r--org.eclipse.riena.sample.app.common/src/org/eclipse/riena/sample/app/common/model/ICustomers.java2
-rw-r--r--org.eclipse.riena.sample.app.common/src/org/eclipse/riena/sample/app/common/model/IHelloWorldService.java5
-rw-r--r--org.eclipse.riena.sample.app.server/src/org/eclipse/riena/internal/sample/app/server/Activator.java7
-rw-r--r--org.eclipse.riena.security.common/src/org/eclipse/riena/internal/security/common/Activator.java11
-rw-r--r--org.eclipse.riena.security.common/src/org/eclipse/riena/internal/security/common/SecurityCallHook.java2
-rw-r--r--org.eclipse.riena.security.common/src/org/eclipse/riena/security/common/ISubjectHolderService.java7
-rw-r--r--org.eclipse.riena.security.common/src/org/eclipse/riena/security/common/authentication/ClientLogin.java4
-rw-r--r--org.eclipse.riena.security.common/src/org/eclipse/riena/security/common/authentication/IAuthenticationService.java1
-rw-r--r--org.eclipse.riena.security.common/src/org/eclipse/riena/security/common/authorization/IAuthorizationService.java1
-rw-r--r--org.eclipse.riena.security.common/src/org/eclipse/riena/security/common/authorization/IPermissionCache.java2
-rw-r--r--org.eclipse.riena.security.common/src/org/eclipse/riena/security/common/authorization/RienaPolicy.java2
-rw-r--r--org.eclipse.riena.security.common/src/org/eclipse/riena/security/common/authorization/Sentinel.java4
-rw-r--r--org.eclipse.riena.security.common/src/org/eclipse/riena/security/common/authorization/internal/PermissionCache.java2
-rw-r--r--org.eclipse.riena.security.common/src/org/eclipse/riena/security/common/session/ISessionHolderService.java7
-rw-r--r--org.eclipse.riena.security.server/src/org/eclipse/riena/internal/security/server/Activator.java5
-rw-r--r--org.eclipse.riena.security.server/src/org/eclipse/riena/internal/security/server/SecurityServiceHook.java10
-rw-r--r--org.eclipse.riena.security.server/src/org/eclipse/riena/security/server/session/ISessionService.java1
-rw-r--r--org.eclipse.riena.security.services/src/org/eclipse/riena/internal/security/authenticationservice/AuthenticationService.java8
-rw-r--r--org.eclipse.riena.security.services/src/org/eclipse/riena/internal/security/authorizationservice/AuthorizationService.java2
-rw-r--r--org.eclipse.riena.security.services/src/org/eclipse/riena/internal/security/services/Activator.java12
-rw-r--r--org.eclipse.riena.security.services/src/org/eclipse/riena/internal/security/sessionservice/SessionService.java4
-rw-r--r--org.eclipse.riena.security.services/src/org/eclipse/riena/security/authorizationservice/IPermissionStore.java2
-rw-r--r--org.eclipse.riena.security.services/src/org/eclipse/riena/security/sessionservice/ISessionProvider.java31
-rw-r--r--org.eclipse.riena.security.services/src/org/eclipse/riena/security/sessionservice/ISessionStore.java2
-rw-r--r--org.eclipse.riena.security.simpleservices/src/org/eclipse/riena/internal/security/simpleservices/Activator.java6
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/core/exception/ExceptionHandlerManagerTest.java12
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/security/authorizationservice/AuthorizationTest.java4
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/security/authorizationservice/SentinelTest.java12
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/security/services/itest/authentication/AuthenticationClientITest.java8
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/security/services/itest/authentication/AuthenticationLoginModuleITest.java4
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/security/services/itest/authorization/AuthorizationServiceITest.java12
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/security/services/itest/session/SessionServiceITest.java4
53 files changed, 385 insertions, 414 deletions
diff --git a/org.eclipse.riena.communication.console/src/org/eclipse/riena/internal/communication/console/Activator.java b/org.eclipse.riena.communication.console/src/org/eclipse/riena/internal/communication/console/Activator.java
index 47a3ec0..9e89f2b 100644
--- a/org.eclipse.riena.communication.console/src/org/eclipse/riena/internal/communication/console/Activator.java
+++ b/org.eclipse.riena.communication.console/src/org/eclipse/riena/internal/communication/console/Activator.java
@@ -46,9 +46,10 @@ public class Activator implements BundleActivator {
// the filter applies only if the service is living in this container
// e.g. server.
String filter = "(" + RSDPublisherProperties.PROP_IS_REMOTE + "=true)";
- publisherInjector = Inject.service(IServicePublishEventDispatcher.ID).useRanking().useFilter(filter).into(
- console).andStart(context);
- registryInjector = Inject.service(IRemoteServiceRegistry.ID).useRanking().into(console).andStart(context);
+ publisherInjector = Inject.service(IServicePublishEventDispatcher.class.getName()).useRanking().useFilter(
+ filter).into(console).andStart(context);
+ registryInjector = Inject.service(IRemoteServiceRegistry.class.getName()).useRanking().into(console).andStart(
+ context);
consoleReg = context.registerService(CommandProvider.class.getName(), console, new Hashtable<String, String>());
}
diff --git a/org.eclipse.riena.communication.core/src/org/eclipse/riena/communication/core/IRemoteServiceRegistry.java b/org.eclipse.riena.communication.core/src/org/eclipse/riena/communication/core/IRemoteServiceRegistry.java
index 7cf468a..ce42fcb 100644
--- a/org.eclipse.riena.communication.core/src/org/eclipse/riena/communication/core/IRemoteServiceRegistry.java
+++ b/org.eclipse.riena.communication.core/src/org/eclipse/riena/communication/core/IRemoteServiceRegistry.java
@@ -16,25 +16,32 @@ import org.eclipse.riena.communication.core.factory.IRemoteServiceFactory;
import org.eclipse.riena.communication.core.publisher.IServicePublishEventDispatcher;
/**
- * The IRemoteServiceRegistry adds the ability to register, unregister and manage "remote services" as OSGi Services
- * within an OSGi runtime (called client container). A "remote service" could be an OSGi Services which is hosted within
- * another OSGi runtime (called server container). A "remote service" is represented by a
- * {@link IRemoteServiceReference} within the client container. A IRemoteServiceReference holds a proxy reference which
+ * The IRemoteServiceRegistry adds the ability to register, unregister and
+ * manage "remote services" as OSGi Services within an OSGi runtime (called
+ * client container). A "remote service" could be an OSGi Services which is
+ * hosted within another OSGi runtime (called server container). A "remote
+ * service" is represented by a {@link IRemoteServiceReference} within the
+ * client container. A IRemoteServiceReference holds a proxy reference which
* points the service end point.
* <p>
- * A IRemoteServiceReferences becomes registered as "remote" OSGi Service within the client container by call
- * {@link #registerService(IRemoteServiceReference)} . #registerService returns a registration object
- * {@link IRemoteServiceRegistration} which points the registered "remote" OSGi service. Call
- * {@link #unregisterService(IRemoteServiceReference)} or {@link IRemoteServiceRegistration#unregister()} to unregister
- * a "remote" OSGi Service
+ * A IRemoteServiceReferences becomes registered as "remote" OSGi Service within
+ * the client container by call
+ * {@link #registerService(IRemoteServiceReference)} . #registerService returns
+ * a registration object {@link IRemoteServiceRegistration} which points the
+ * registered "remote" OSGi service. Call
+ * {@link #unregisterService(IRemoteServiceReference)} or
+ * {@link IRemoteServiceRegistration#unregister()} to unregister a "remote" OSGi
+ * Service
* <p>
- * The RemoteServiceRegistry is available as OSGi Service. The registration name is {@link #ID}.
+ * The RemoteServiceRegistry is available as OSGi Service. The registration name
+ * is {@link #ID}.
* <p>
- * The {@link IRemoteServiceFactory} can use to create a IRemoteServiceReference by given end points parameters and to
- * register a IRemoteServiceReference into the IRemoteServiceRegistry.
+ * The {@link IRemoteServiceFactory} can use to create a IRemoteServiceReference
+ * by given end points parameters and to register a IRemoteServiceReference into
+ * the IRemoteServiceRegistry.
* <p>
- * OSGi Service could be published as service end point from a server container by the
- * {@link IServicePublishEventDispatcher}
+ * OSGi Service could be published as service end point from a server container
+ * by the {@link IServicePublishEventDispatcher}
*
* @author Alexander Ziegler
*
@@ -45,44 +52,41 @@ import org.eclipse.riena.communication.core.publisher.IServicePublishEventDispat
*/
public interface IRemoteServiceRegistry {
- /**
- * Service ID
- */
- String ID = IRemoteServiceRegistry.class.getName();
+ /**
+ * Registers the given reference as OSGi Service. Answers a
+ * {@link IRemoteServiceRegistration} object which points the registered
+ * reference. A registered reference becomes automatically registered as
+ * "remote" OSGi Service within the local OSGi container.
+ * <p>
+ * To unregister a reference from the Remote Service Registry call
+ * {@link #unregisterService(IRemoteServiceReference)} or
+ * {@link IRemoteServiceRegistration#unregister()}
+ *
+ * @param reference
+ * @return the RemoteServiceRegistration object
+ *
+ * @see #unregisterService(IRemoteServiceReference)
+ * @see IRemoteServiceRegistration#unregister()
+ */
+ IRemoteServiceRegistration registerService(IRemoteServiceReference reference);
- /**
- * Registers the given reference as OSGi Service. Answers a {@link IRemoteServiceRegistration} object which points
- * the registered reference. A registered reference becomes automatically registered as "remote" OSGi Service within the
- * local OSGi container.
- * <p>
- * To unregister a reference from the Remote Service Registry call
- * {@link #unregisterService(IRemoteServiceReference)} or {@link IRemoteServiceRegistration#unregister()}
- *
- * @param reference
- * @return the RemoteServiceRegistration object
- *
- * @see #unregisterService(IRemoteServiceReference)
- * @see IRemoteServiceRegistration#unregister()
- */
- IRemoteServiceRegistration registerService(IRemoteServiceReference reference);
+ /**
+ * Unregisters the given reference from the Remote Service Registry. The
+ * associated "remote" OSGi Service become automatically unregistered.
+ *
+ * @param reference
+ * to unregister
+ *
+ * @see #registerService(IRemoteServiceReference)
+ */
+ void unregisterService(IRemoteServiceReference reference);
- /**
- * Unregisters the given reference from the Remote Service Registry. The associated "remote" OSGi Service become
- * automatically unregistered.
- *
- * @param reference
- * to unregister
- *
- * @see #registerService(IRemoteServiceReference)
- */
- void unregisterService(IRemoteServiceReference reference);
-
- /**
- * Answers a list of {@link IRemoteServiceRegistration} objects for all registered "remote" OSGi Services for the
- * given hostId
- *
- * @param hostId
- * @return a list of IRemoteServiceRegistration objects
- */
- List<IRemoteServiceRegistration> registeredServices(String hostId);
+ /**
+ * Answers a list of {@link IRemoteServiceRegistration} objects for all
+ * registered "remote" OSGi Services for the given hostId
+ *
+ * @param hostId
+ * @return a list of IRemoteServiceRegistration objects
+ */
+ List<IRemoteServiceRegistration> registeredServices(String hostId);
}
diff --git a/org.eclipse.riena.communication.core/src/org/eclipse/riena/communication/core/factory/IRemoteServiceFactory.java b/org.eclipse.riena.communication.core/src/org/eclipse/riena/communication/core/factory/IRemoteServiceFactory.java
index 08802ba..32321d4 100644
--- a/org.eclipse.riena.communication.core/src/org/eclipse/riena/communication/core/factory/IRemoteServiceFactory.java
+++ b/org.eclipse.riena.communication.core/src/org/eclipse/riena/communication/core/factory/IRemoteServiceFactory.java
@@ -17,11 +17,14 @@ import org.eclipse.riena.communication.core.hooks.ICallMessageContextAccessor;
import org.eclipse.riena.communication.core.publisher.IServicePublisher;
/**
- * The IRemoteServiceFactory creates {@link IRemoteServiceReference} for given protocol specifically service end point
- * description. The IRemoteServiceReference holds a proxy reference instance to the service end point.
+ * The IRemoteServiceFactory creates {@link IRemoteServiceReference} for given
+ * protocol specifically service end point description. The
+ * IRemoteServiceReference holds a proxy reference instance to the service end
+ * point.
* <p>
- * An implementation of an IRemoteServiceFactory is responsible for a protocol (e.g. Hessian). The implementation has be
- * registered as OSGi Service and set with follow property (see also {@link IRemoteServiceProtocol}):<br>
+ * An implementation of an IRemoteServiceFactory is responsible for a protocol
+ * (e.g. Hessian). The implementation has be registered as OSGi Service and set
+ * with follow property (see also {@link IRemoteServiceProtocol}):<br>
*
* <p>
* Code sample:<br>
@@ -37,9 +40,10 @@ import org.eclipse.riena.communication.core.publisher.IServicePublisher;
* <p>
*
* <b>NOTE</b><br>
- * The Riena communication bundle content includes generic class loading and object instantiation or delegates this behavior to other
- * Riena communication bundles. Riena supports Eclipse-BuddyPolicy concept. For further information about Riena class loading and
- * instanciation please read /readme.txt.
+ * The Riena communication bundle content includes generic class loading and
+ * object instantiation or delegates this behavior to other Riena communication
+ * bundles. Riena supports Eclipse-BuddyPolicy concept. For further information
+ * about Riena class loading and instanciation please read /readme.txt.
*
*
* @author Alexander Ziegler
@@ -52,19 +56,14 @@ import org.eclipse.riena.communication.core.publisher.IServicePublisher;
*/
public interface IRemoteServiceFactory extends IRemoteServiceProtocol {
- /**
- * The OSGi Service name
- */
- String ID = IRemoteServiceFactory.class.getName();
+ /**
+ * Creates a protocol specifically IRemoteServcieRefernce for the given end
+ * point description. Answers the IRemoteServiceReference.
+ *
+ * @param remoteServiceDesc
+ * @return the remote service references
+ */
+ IRemoteServiceReference createProxy(RemoteServiceDescription remoteServiceDesc);
- /**
- * Creates a protocol specifically IRemoteServcieRefernce for the given end point description. Answers the
- * IRemoteServiceReference.
- *
- * @param remoteServiceDesc
- * @return the remote service references
- */
- IRemoteServiceReference createProxy(RemoteServiceDescription remoteServiceDesc);
-
- ICallMessageContextAccessor getMessageContextAccessor();
+ ICallMessageContextAccessor getMessageContextAccessor();
}
diff --git a/org.eclipse.riena.communication.core/src/org/eclipse/riena/communication/core/factory/RemoteServiceFactory.java b/org.eclipse.riena.communication.core/src/org/eclipse/riena/communication/core/factory/RemoteServiceFactory.java
index 9644cfc..de608cf 100644
--- a/org.eclipse.riena.communication.core/src/org/eclipse/riena/communication/core/factory/RemoteServiceFactory.java
+++ b/org.eclipse.riena.communication.core/src/org/eclipse/riena/communication/core/factory/RemoteServiceFactory.java
@@ -78,7 +78,7 @@ public class RemoteServiceFactory {
*/
public RemoteServiceFactory() {
this(Activator.getContext());
- Inject.service(IRemoteServiceRegistry.ID).into(this).andStart(Activator.getContext());
+ Inject.service(IRemoteServiceRegistry.class.getName()).into(this).andStart(Activator.getContext());
}
public void bind(IRemoteServiceRegistry registry) {
@@ -262,7 +262,7 @@ public class RemoteServiceFactory {
// find a factory for this specific protocol
String filter = "(" + IRemoteServiceFactory.PROP_PROTOCOL + "=" + rsd.getProtocol() + ")"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
try {
- references = context.getServiceReferences(IRemoteServiceFactory.ID, filter);
+ references = context.getServiceReferences(IRemoteServiceFactory.class.getName(), filter);
} catch (InvalidSyntaxException e) {
e.printStackTrace();
return null;
diff --git a/org.eclipse.riena.communication.core/src/org/eclipse/riena/communication/core/hooks/ICallHook.java b/org.eclipse.riena.communication.core/src/org/eclipse/riena/communication/core/hooks/ICallHook.java
index f51015c..a06feec 100644
--- a/org.eclipse.riena.communication.core/src/org/eclipse/riena/communication/core/hooks/ICallHook.java
+++ b/org.eclipse.riena.communication.core/src/org/eclipse/riena/communication/core/hooks/ICallHook.java
@@ -12,8 +12,6 @@ package org.eclipse.riena.communication.core.hooks;
public interface ICallHook {
- String ID = ICallHook.class.getName();
-
void beforeCall(CallContext context);
void afterCall(CallContext context);
diff --git a/org.eclipse.riena.communication.core/src/org/eclipse/riena/communication/core/hooks/IServiceHook.java b/org.eclipse.riena.communication.core/src/org/eclipse/riena/communication/core/hooks/IServiceHook.java
index 77bb80b..eababc0 100644
--- a/org.eclipse.riena.communication.core/src/org/eclipse/riena/communication/core/hooks/IServiceHook.java
+++ b/org.eclipse.riena.communication.core/src/org/eclipse/riena/communication/core/hooks/IServiceHook.java
@@ -12,8 +12,6 @@ package org.eclipse.riena.communication.core.hooks;
public interface IServiceHook {
- String ID = IServiceHook.class.getName();
-
void beforeService(ServiceContext context);
void afterService(ServiceContext context);
diff --git a/org.eclipse.riena.communication.core/src/org/eclipse/riena/communication/core/publisher/IServicePublishEventDispatcher.java b/org.eclipse.riena.communication.core/src/org/eclipse/riena/communication/core/publisher/IServicePublishEventDispatcher.java
index 4a476e1..513ef5b 100644
--- a/org.eclipse.riena.communication.core/src/org/eclipse/riena/communication/core/publisher/IServicePublishEventDispatcher.java
+++ b/org.eclipse.riena.communication.core/src/org/eclipse/riena/communication/core/publisher/IServicePublishEventDispatcher.java
@@ -13,10 +13,11 @@ package org.eclipse.riena.communication.core.publisher;
import org.eclipse.riena.communication.core.RemoteServiceDescription;
/**
- * Implementations of IServicePublishEventDispatcher provide a List of all service end points for published OSGi
- * Services within a container.
+ * Implementations of IServicePublishEventDispatcher provide a List of all
+ * service end points for published OSGi Services within a container.
*
- * An implementation should be registered as OSGi Service and maybe published as "remote" OSGi service itself.
+ * An implementation should be registered as OSGi Service and maybe published as
+ * "remote" OSGi service itself.
*
* @author Alexander Ziegler
* @author Christian Campo
@@ -25,14 +26,10 @@ import org.eclipse.riena.communication.core.RemoteServiceDescription;
*
*/
public interface IServicePublishEventDispatcher {
- /**
- * The name of the OSGi Service.
- */
- String ID = IServicePublishEventDispatcher.class.getName();
- /**
- *
- * @return the list of service end points for published OSGi Services.
- */
- RemoteServiceDescription[] getAllServices();
+ /**
+ *
+ * @return the list of service end points for published OSGi Services.
+ */
+ RemoteServiceDescription[] getAllServices();
}
diff --git a/org.eclipse.riena.communication.core/src/org/eclipse/riena/communication/core/publisher/IServicePublisher.java b/org.eclipse.riena.communication.core/src/org/eclipse/riena/communication/core/publisher/IServicePublisher.java
index a52fd5a..1dbe0e7 100644
--- a/org.eclipse.riena.communication.core/src/org/eclipse/riena/communication/core/publisher/IServicePublisher.java
+++ b/org.eclipse.riena.communication.core/src/org/eclipse/riena/communication/core/publisher/IServicePublisher.java
@@ -16,10 +16,12 @@ import org.eclipse.riena.communication.core.factory.IRemoteServiceFactory;
import org.eclipse.riena.communication.core.hooks.IServiceMessageContextAccessor;
/**
- * Implementations of IServicePublisher publish OSGi services as service end points.
+ * Implementations of IServicePublisher publish OSGi services as service end
+ * points.
*
- * An implementation is responsible for a specifically protocol (e.g. Hessian). The implementation has be registered as
- * OSGi Service and set with follow key/value property (see also {@link IRemoteServiceProtocol}):<br>
+ * An implementation is responsible for a specifically protocol (e.g. Hessian).
+ * The implementation has be registered as OSGi Service and set with follow
+ * key/value property (see also {@link IRemoteServiceProtocol}):<br>
*
* 'riena.protocol'=[aProtocol] (e.g. for aProtocol set 'hessian')<br>
* <p>
@@ -36,9 +38,10 @@ import org.eclipse.riena.communication.core.hooks.IServiceMessageContextAccessor
* <p>
*
* <b>NOTE</b><br>
- * The Riena communication bundle content includes generic class loading and object instantiation or delegates this behavior to other
- * Riena communication bundles. Riena supports Eclipse-BuddyPolicy concept. For further information about Riena class loading and
- * instanciation please read /readme.txt.
+ * The Riena communication bundle content includes generic class loading and
+ * object instantiation or delegates this behavior to other Riena communication
+ * bundles. Riena supports Eclipse-BuddyPolicy concept. For further information
+ * about Riena class loading and instanciation please read /readme.txt.
*
*
* @author Alexander Ziegler
@@ -51,12 +54,10 @@ import org.eclipse.riena.communication.core.hooks.IServiceMessageContextAccessor
*/
public interface IServicePublisher extends IRemoteServiceProtocol {
- String ID = IServicePublisher.class.getName();
+ String publishService(RemoteServiceDescription rsd);
- String publishService(RemoteServiceDescription rsd);
+ void unpublishService(String path);
- void unpublishService(String path);
-
- IServiceMessageContextAccessor getMessageContextAccessor();
+ IServiceMessageContextAccessor getMessageContextAccessor();
}
diff --git a/org.eclipse.riena.communication.core/src/org/eclipse/riena/internal/communication/core/Activator.java b/org.eclipse.riena.communication.core/src/org/eclipse/riena/internal/communication/core/Activator.java
index 4ad5fdc..b21561f 100644
--- a/org.eclipse.riena.communication.core/src/org/eclipse/riena/internal/communication/core/Activator.java
+++ b/org.eclipse.riena.communication.core/src/org/eclipse/riena/internal/communication/core/Activator.java
@@ -57,10 +57,11 @@ public class Activator extends RienaActivator {
serviceRegistry.start();
Hashtable<String, Object> properties = ServiceDescriptor.newDefaultServiceProperties();
- regServiceRegistry = context.registerService(IRemoteServiceRegistry.ID, serviceRegistry, properties);
+ regServiceRegistry = context.registerService(IRemoteServiceRegistry.class.getName(), serviceRegistry,
+ properties);
final Logger logger = getLogger(Activator.class.getName());
- context.registerService(ICallHook.ID, new ICallHook() {
+ context.registerService(ICallHook.class.getName(), new ICallHook() {
public void afterCall(CallContext context) {
logger.log(LogService.LOG_DEBUG, "after call (in hook) method=" + context.getMethodName()); //$NON-NLS-1$
diff --git a/org.eclipse.riena.communication.core/src/org/eclipse/riena/internal/communication/core/factory/CallHooksProxy.java b/org.eclipse.riena.communication.core/src/org/eclipse/riena/internal/communication/core/factory/CallHooksProxy.java
index 5d3df58..ac04af2 100644
--- a/org.eclipse.riena.communication.core/src/org/eclipse/riena/internal/communication/core/factory/CallHooksProxy.java
+++ b/org.eclipse.riena.communication.core/src/org/eclipse/riena/internal/communication/core/factory/CallHooksProxy.java
@@ -33,7 +33,7 @@ public class CallHooksProxy extends AbstractHooksProxy {
public CallHooksProxy(Object proxiedInstance) {
super(proxiedInstance);
- Inject.service(ICallHook.ID).into(this).andStart(Activator.getContext());
+ Inject.service(ICallHook.class.getName()).into(this).andStart(Activator.getContext());
}
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
diff --git a/org.eclipse.riena.communication.factory.hessian/src/org/eclipse/riena/internal/communication/factory/hessian/Activator.java b/org.eclipse.riena.communication.factory.hessian/src/org/eclipse/riena/internal/communication/factory/hessian/Activator.java
index b960f6d..885f259 100644
--- a/org.eclipse.riena.communication.factory.hessian/src/org/eclipse/riena/internal/communication/factory/hessian/Activator.java
+++ b/org.eclipse.riena.communication.factory.hessian/src/org/eclipse/riena/internal/communication/factory/hessian/Activator.java
@@ -40,7 +40,7 @@ public class Activator extends RienaActivator {
Hashtable<String, Object> properties = ServiceDescriptor.newDefaultServiceProperties();
properties.put(IRemoteServiceFactory.PROP_PROTOCOL, factory.getProtocol());
- regFactory = context.registerService(IRemoteServiceFactory.ID, factory, properties);
+ regFactory = context.registerService(IRemoteServiceFactory.class.getName(), factory, properties);
}
/*
diff --git a/org.eclipse.riena.communication.publisher.hessian/src/org/eclipse/riena/internal/communication/publisher/hessian/Activator.java b/org.eclipse.riena.communication.publisher.hessian/src/org/eclipse/riena/internal/communication/publisher/hessian/Activator.java
index e938360..abf5bb7 100644
--- a/org.eclipse.riena.communication.publisher.hessian/src/org/eclipse/riena/internal/communication/publisher/hessian/Activator.java
+++ b/org.eclipse.riena.communication.publisher.hessian/src/org/eclipse/riena/internal/communication/publisher/hessian/Activator.java
@@ -44,7 +44,7 @@ public class Activator extends RienaActivator {
publisher = new HessianRemoteServicePublisher();
Hashtable<String, Object> properties = ServiceDescriptor.newDefaultServiceProperties();
properties.put(IServicePublisher.PROP_PROTOCOL, publisher.getProtocol());
- publisherReg = context.registerService(IServicePublisher.ID, publisher, properties);
+ publisherReg = context.registerService(IServicePublisher.class.getName(), publisher, properties);
}
/*
diff --git a/org.eclipse.riena.communication.publisher/src/org/eclipse/riena/internal/communication/publisher/Activator.java b/org.eclipse.riena.communication.publisher/src/org/eclipse/riena/internal/communication/publisher/Activator.java
index 90911ee..51b6d3e 100644
--- a/org.eclipse.riena.communication.publisher/src/org/eclipse/riena/internal/communication/publisher/Activator.java
+++ b/org.eclipse.riena.communication.publisher/src/org/eclipse/riena/internal/communication/publisher/Activator.java
@@ -48,7 +48,8 @@ public class Activator extends RienaActivator {
logger = getLogger(Activator.class.getName());
dispatcher = new ServicePublishEventDispatcher(context);
- publisherInjector = Inject.service(IServicePublisher.ID).useRanking().into(dispatcher).andStart(context);
+ publisherInjector = Inject.service(IServicePublisher.class.getName()).useRanking().into(dispatcher).andStart(
+ context);
// register as OSGi service, the start will pick up the OSGi service and
// publish it
@@ -57,7 +58,7 @@ public class Activator extends RienaActivator {
properties.put(RSDPublisherProperties.PROP_REMOTE_PROTOCOL, "hessian");
properties.put(RSDPublisherProperties.PROP_REMOTE_PATH, "/ServicePublisherWS");
- context.registerService(IServicePublishEventDispatcher.ID, dispatcher, properties);
+ context.registerService(IServicePublishEventDispatcher.class.getName(), dispatcher, properties);
dispatcher.start();
@@ -65,7 +66,7 @@ public class Activator extends RienaActivator {
// servicePublishEventDispatcher
updateNotifierRemoteService = new UpdateNotifierRemoteService(dispatcher);
context.addServiceListener(updateNotifierRemoteService);
- context.registerService(IServiceHook.ID, new IServiceHook() {
+ context.registerService(IServiceHook.class.getName(), new IServiceHook() {
public void afterService(ServiceContext context) {
logger.log(LogService.LOG_DEBUG, "after service (in hook)");
diff --git a/org.eclipse.riena.communication.publisher/src/org/eclipse/riena/internal/communication/publisher/ServiceHooksProxy.java b/org.eclipse.riena.communication.publisher/src/org/eclipse/riena/internal/communication/publisher/ServiceHooksProxy.java
index 14b451d..9014ad6 100644
--- a/org.eclipse.riena.communication.publisher/src/org/eclipse/riena/internal/communication/publisher/ServiceHooksProxy.java
+++ b/org.eclipse.riena.communication.publisher/src/org/eclipse/riena/internal/communication/publisher/ServiceHooksProxy.java
@@ -34,7 +34,7 @@ public class ServiceHooksProxy extends AbstractHooksProxy implements InvocationH
public ServiceHooksProxy(Object serviceInstance) {
super(serviceInstance);
- Inject.service(IServiceHook.ID).into(this).andStart(Activator.getContext());
+ Inject.service(IServiceHook.class.getName()).into(this).andStart(Activator.getContext());
}
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
diff --git a/org.eclipse.riena.communication.sample.pingpong.client/src/org/eclipse/riena/internal/communication/sample/pingpong/client/Activator.java b/org.eclipse.riena.communication.sample.pingpong.client/src/org/eclipse/riena/internal/communication/sample/pingpong/client/Activator.java
index 23c5563..1acb7bc 100644
--- a/org.eclipse.riena.communication.sample.pingpong.client/src/org/eclipse/riena/internal/communication/sample/pingpong/client/Activator.java
+++ b/org.eclipse.riena.communication.sample.pingpong.client/src/org/eclipse/riena/internal/communication/sample/pingpong/client/Activator.java
@@ -19,57 +19,57 @@ import org.osgi.framework.ServiceEvent;
import org.osgi.framework.ServiceListener;
import org.osgi.framework.ServiceReference;
-
/**
* The Ping Pong sample shows how to find a "remote" OSGi Services.
*
*
- * This sample Activator finds an IPingPong "remote" OSGi Service by the ServiceRegistry. Sends a Ping to the IPingPong
- * service and writes the pong result into the console.
+ * This sample Activator finds an IPingPong "remote" OSGi Service by the
+ * ServiceRegistry. Sends a Ping to the IPingPong service and writes the pong
+ * result into the console.
*
* @author Alexander Ziegler
*
*/
public class Activator implements BundleActivator {
- private BundleContext context;
+ private BundleContext context;
- public void start(BundleContext context) throws Exception {
- this.context = context;
- ServiceReference pingPongRef = context.getServiceReference(IPingPong.ID);
- if (pingPongRef != null) {
- new PingClient().sendPing(pingPongRef);
- } else {
- context.addServiceListener(new PingClient(), "(objectClass=" + IPingPong.ID + ")");
- }
- }
+ public void start(BundleContext context) throws Exception {
+ this.context = context;
+ ServiceReference pingPongRef = context.getServiceReference(IPingPong.class.getName());
+ if (pingPongRef != null) {
+ new PingClient().sendPing(pingPongRef);
+ } else {
+ context.addServiceListener(new PingClient(), "(objectClass=" + IPingPong.class.getName() + ")");
+ }
+ }
- public void stop(BundleContext context) throws Exception {
- this.context = null;
- }
+ public void stop(BundleContext context) throws Exception {
+ this.context = null;
+ }
- class PingClient implements ServiceListener {
+ class PingClient implements ServiceListener {
- public void serviceChanged(ServiceEvent event) {
+ public void serviceChanged(ServiceEvent event) {
- ServiceReference pingPongRef = event.getServiceReference();
- sendPing(pingPongRef);
+ ServiceReference pingPongRef = event.getServiceReference();
+ sendPing(pingPongRef);
- }
+ }
- void sendPing(ServiceReference pingPongRef) {
- IPingPong pingPong = (IPingPong) context.getService(pingPongRef);
- if (pingPong == null) {
- return;
- }
+ void sendPing(ServiceReference pingPongRef) {
+ IPingPong pingPong = (IPingPong) context.getService(pingPongRef);
+ if (pingPong == null) {
+ return;
+ }
- Ping ping = new Ping();
- ping.setText("I ping you and you pong me");
+ Ping ping = new Ping();
+ ping.setText("I ping you and you pong me");
- Pong pong = pingPong.ping(ping);
- System.out.println("PingPong::Client:: " + pong);
+ Pong pong = pingPong.ping(ping);
+ System.out.println("PingPong::Client:: " + pong);
- }
- }
+ }
+ }
}
diff --git a/org.eclipse.riena.communication.sample.pingpong.common/src/org/eclipse/riena/communication/sample/pingpong/common/IPingPong.java b/org.eclipse.riena.communication.sample.pingpong.common/src/org/eclipse/riena/communication/sample/pingpong/common/IPingPong.java
index eafb948..bf4390b 100644
--- a/org.eclipse.riena.communication.sample.pingpong.common/src/org/eclipse/riena/communication/sample/pingpong/common/IPingPong.java
+++ b/org.eclipse.riena.communication.sample.pingpong.common/src/org/eclipse/riena/communication/sample/pingpong/common/IPingPong.java
@@ -18,17 +18,12 @@ package org.eclipse.riena.communication.sample.pingpong.common;
*/
public interface IPingPong {
- /**
- * Service ID
- */
- String ID = IPingPong.class.getName();
-
- /**
- * Receives the given ping and answers a pong
- *
- * @param ping
- * @return pong
- */
- Pong ping(Ping ping);
+ /**
+ * Receives the given ping and answers a pong
+ *
+ * @param ping
+ * @return pong
+ */
+ Pong ping(Ping ping);
}
diff --git a/org.eclipse.riena.communication.sample.pingpong.server/src/org/eclipse/riena/internal/communication/sample/pingpong/server/Activator.java b/org.eclipse.riena.communication.sample.pingpong.server/src/org/eclipse/riena/internal/communication/sample/pingpong/server/Activator.java
index 2891e00..f3acde9 100644
--- a/org.eclipse.riena.communication.sample.pingpong.server/src/org/eclipse/riena/internal/communication/sample/pingpong/server/Activator.java
+++ b/org.eclipse.riena.communication.sample.pingpong.server/src/org/eclipse/riena/internal/communication/sample/pingpong/server/Activator.java
@@ -41,7 +41,7 @@ public class Activator implements BundleActivator {
properties.put(RSDPublisherProperties.PROP_REMOTE_PROTOCOL, "hessian");
properties.put(RSDPublisherProperties.PROP_REMOTE_PATH, "/PingPongWS");
- pingPongRegHessian = context.registerService(IPingPong.ID, pingPong, properties);
+ pingPongRegHessian = context.registerService(IPingPong.class.getName(), pingPong, properties);
// create xfire service
// pingPong = new PingPong();
diff --git a/org.eclipse.riena.core/src/org/eclipse/riena/core/cache/IGenericObjectCache.java b/org.eclipse.riena.core/src/org/eclipse/riena/core/cache/IGenericObjectCache.java
index c4a2162..698b2c0 100644
--- a/org.eclipse.riena.core/src/org/eclipse/riena/core/cache/IGenericObjectCache.java
+++ b/org.eclipse.riena.core/src/org/eclipse/riena/core/cache/IGenericObjectCache.java
@@ -31,8 +31,6 @@ import java.util.HashMap;
*/
public interface IGenericObjectCache {
- String ID = IGenericObjectCache.class.getName();
-
/**
* returns true if this is a global cache
*
diff --git a/org.eclipse.riena.core/src/org/eclipse/riena/core/exception/IExceptionHandler.java b/org.eclipse.riena.core/src/org/eclipse/riena/core/exception/IExceptionHandler.java
index 0ec7930..3803c2e 100644
--- a/org.eclipse.riena.core/src/org/eclipse/riena/core/exception/IExceptionHandler.java
+++ b/org.eclipse.riena.core/src/org/eclipse/riena/core/exception/IExceptionHandler.java
@@ -13,69 +13,67 @@ package org.eclipse.riena.core.exception;
import org.eclipse.equinox.log.Logger;
import org.eclipse.riena.core.exception.IExceptionHandlerManager.Action;
-
/**
* ExceptionHandler can handle exceptions
*/
public interface IExceptionHandler {
- /**
- * Service ID
- */
- String ID = IExceptionHandler.class.getName();
- /**
- * Indicate that this handler will be invoked before the named handler <code>before</code> If <code>before</code>
- * is <code>null</code> or the named handler does not exists and there are more than one handlers then the time of
- * invocation for this handler will be indeterminate.
- *
- * @return a handler name
- */
- String getBefore();
+ /**
+ * Indicate that this handler will be invoked before the named handler
+ * <code>before</code> If <code>before</code> is <code>null</code> or
+ * the named handler does not exists and there are more than one handlers
+ * then the time of invocation for this handler will be indeterminate.
+ *
+ * @return a handler name
+ */
+ String getBefore();
- /**
- * Anwers this handler name
- *
- * @pre name != null
- *
- * @return this handler name
- */
- String getName();
+ /**
+ * Anwers this handler name
+ *
+ * @pre name != null
+ *
+ * @return this handler name
+ */
+ String getName();
- /**
- * Check if the exception passed can be handled and return an {@link Action} how might to process. This method
- * should only be called in top level catch blocks like main, ui thread etc... From other locations inside a catch
- * block use handleCaught(..)
- *
- * @pre t != null
- * @post result != null
- *
- * @param t
- * exception to be handled
- * @param msg
- * an optional message
- * @param logger
- * to be used for logging
- *
- * @return the Action how to process
- */
- Action handleUncaught(Throwable t, String msg, Logger logger);
+ /**
+ * Check if the exception passed can be handled and return an {@link Action}
+ * how might to process. This method should only be called in top level
+ * catch blocks like main, ui thread etc... From other locations inside a
+ * catch block use handleCaught(..)
+ *
+ * @pre t != null
+ * @post result != null
+ *
+ * @param t
+ * exception to be handled
+ * @param msg
+ * an optional message
+ * @param logger
+ * to be used for logging
+ *
+ * @return the Action how to process
+ */
+ Action handleUncaught(Throwable t, String msg, Logger logger);
- /**
- * Check if the exception passed can be handled and return an {@link Action} how might to process. This method
- * should be used anywhere where an exceptions is catched directly.
- *
- * @pre t != null
- * @post result != null
- *
- * @param t
- * exception to be handled
- * @param msg
- * an optional message
- * @param logger
- * to be used for logging
- *
- * @return the Action how to process
- *
- */
- Action handleCaught(Throwable t, String msg, Logger logger);
+ /**
+ * Check if the exception passed can be handled and return an {@link Action}
+ * how might to process. This method should be used anywhere where an
+ * exceptions is catched directly.
+ *
+ * @pre t != null
+ * @post result != null
+ *
+ * @param t
+ * exception to be handled
+ * @param msg
+ * an optional message
+ * @param logger
+ * to be used for logging
+ *
+ * @return the Action how to process
+ *
+ */
+ Action handleCaught(Throwable t, String msg, Logger logger);
}
diff --git a/org.eclipse.riena.core/src/org/eclipse/riena/core/exception/IExceptionHandlerManager.java b/org.eclipse.riena.core/src/org/eclipse/riena/core/exception/IExceptionHandlerManager.java
index fea2801..b90371a 100644
--- a/org.eclipse.riena.core/src/org/eclipse/riena/core/exception/IExceptionHandlerManager.java
+++ b/org.eclipse.riena.core/src/org/eclipse/riena/core/exception/IExceptionHandlerManager.java
@@ -17,100 +17,100 @@ import org.eclipse.equinox.log.Logger;
*/
public interface IExceptionHandlerManager {
- /**
- * Service ID
- */
- String ID = IExceptionHandlerManager.class.getName();
+ /**
+ * Defines actions how to process after the exception was handled.
+ */
+ public enum Action {
- /**
- * Defines actions how to process after the exception was handled.
- */
- public enum Action {
+ NotHandled,
- NotHandled,
+ Ok,
- Ok,
+ Retry,
- Retry,
+ Cancel
+ }
- Cancel
- }
+ /**
+ * Check if the exception passed can be handled and return an {@link Action}
+ * how might to process. This method should be used anywhere where an
+ * exceptions is catched directly.
+ *
+ * @pre t != null
+ * @post result != null
+ *
+ * @param t
+ * exception to be handled
+ * @return the Action how to process
+ */
+ Action handleCaught(Throwable t);
- /**
- * Check if the exception passed can be handled and return an {@link Action} how might to process. This method
- * should be used anywhere where an exceptions is catched directly.
- *
- * @pre t != null
- * @post result != null
- *
- * @param t
- * exception to be handled
- * @return the Action how to process
- */
- Action handleCaught(Throwable t);
+ /**
+ * Check if the exception passed can be handled and return an {@link Action}
+ * how might to process. This method should be used anywhere where an
+ * exceptions is catched directly.
+ *
+ * @pre t != null
+ * @post result != null
+ *
+ * @param t
+ * exception to be handled
+ * @param logger
+ * to be used for logging
+ * @return the Action how to process
+ */
+ Action handleCaught(Throwable t, Logger logger);
- /**
- * Check if the exception passed can be handled and return an {@link Action} how might to process. This method
- * should be used anywhere where an exceptions is catched directly.
- *
- * @pre t != null
- * @post result != null
- *
- * @param t
- * exception to be handled
- * @param logger
- * to be used for logging
- * @return the Action how to process
- */
- Action handleCaught(Throwable t, Logger logger);
+ /**
+ * Check if the exception passed can be handled and return an {@link Action}
+ * how might to process. This method should be used anywhere where an
+ * exceptions is catched directly.
+ *
+ * @pre t != null
+ * @post result != null
+ *
+ * @param t
+ * exception to be handled
+ * @param msg
+ * an optional message
+ * @return the Action how to process
+ */
+ Action handleCaught(Throwable t, String msg);
- /**
- * Check if the exception passed can be handled and return an {@link Action} how might to process. This method
- * should be used anywhere where an exceptions is catched directly.
- *
- * @pre t != null
- * @post result != null
- *
- * @param t
- * exception to be handled
- * @param msg
- * an optional message
- * @return the Action how to process
- */
- Action handleCaught(Throwable t, String msg);
+ /**
+ * Check if the exception passed can be handled and return an {@link Action}
+ * how might to process. This method should be used anywhere where an
+ * exceptions is catched directly.
+ *
+ * @pre t != null
+ * @post result != null
+ *
+ * @param t
+ * exception to be handled
+ * @param msg
+ * an optional message
+ * @param logger
+ * to be used for logging
+ * @return the Action how to process
+ */
+ Action handleCaught(Throwable t, String msg, Logger logger);
- /**
- * Check if the exception passed can be handled and return an {@link Action} how might to process. This method
- * should be used anywhere where an exceptions is catched directly.
- *
- * @pre t != null
- * @post result != null
- *
- * @param t
- * exception to be handled
- * @param msg
- * an optional message
- * @param logger
- * to be used for logging
- * @return the Action how to process
- */
- Action handleCaught(Throwable t, String msg, Logger logger);
-
- /**
- * Check if the exception passed can be handled and return an {@link Action} how might to process. This method
- * should only be called in top level catch blocks like main, ui thread etc... From other locations inside a catch
- * block use handleCaught(..)
- *
- * @pre t != null
- * @post result != null
- *
- * @param t
- * exception to be handled
- * @param msg
- * an optional message
- * @param logger
- * to be used for logging
- * @return the Action how to process
- */
- Action handleUncaught(Throwable t, String msg, Logger logger);
+ /**
+ * Check if the exception passed can be handled and return an {@link Action}
+ * how might to process. This method should only be called in top level
+ * catch blocks like main, ui thread etc... From other locations inside a
+ * catch block use handleCaught(..)
+ *
+ * @pre t != null
+ * @post result != null
+ *
+ * @param t
+ * exception to be handled
+ * @param msg
+ * an optional message
+ * @param logger
+ * to be used for logging
+ * @return the Action how to process
+ */
+ Action handleUncaught(Throwable t, String msg, Logger logger);
}
diff --git a/org.eclipse.riena.sample.app.common/src/org/eclipse/riena/sample/app/common/model/ICustomerSearch.java b/org.eclipse.riena.sample.app.common/src/org/eclipse/riena/sample/app/common/model/ICustomerSearch.java
index 429e4c3..ed535a0 100644
--- a/org.eclipse.riena.sample.app.common/src/org/eclipse/riena/sample/app/common/model/ICustomerSearch.java
+++ b/org.eclipse.riena.sample.app.common/src/org/eclipse/riena/sample/app/common/model/ICustomerSearch.java
@@ -16,8 +16,6 @@ package org.eclipse.riena.sample.app.common.model;
*/
public interface ICustomerSearch {
- String ID = ICustomerSearch.class.getName();
-
/**
* Retrieves customers from the database. For the query the given customer
* is use as an example (Query by Example (QBE))
diff --git a/org.eclipse.riena.sample.app.common/src/org/eclipse/riena/sample/app/common/model/ICustomers.java b/org.eclipse.riena.sample.app.common/src/org/eclipse/riena/sample/app/common/model/ICustomers.java
index 2593f71..ad9d8e4 100644
--- a/org.eclipse.riena.sample.app.common/src/org/eclipse/riena/sample/app/common/model/ICustomers.java
+++ b/org.eclipse.riena.sample.app.common/src/org/eclipse/riena/sample/app/common/model/ICustomers.java
@@ -15,8 +15,6 @@ package org.eclipse.riena.sample.app.common.model;
*/
public interface ICustomers {
- String ID = ICustomers.class.getName();
-
Integer getNextUniqueCustomerNumber();
void store(Customer customer);
diff --git a/org.eclipse.riena.sample.app.common/src/org/eclipse/riena/sample/app/common/model/IHelloWorldService.java b/org.eclipse.riena.sample.app.common/src/org/eclipse/riena/sample/app/common/model/IHelloWorldService.java
index 7ee556e..47a99cc 100644
--- a/org.eclipse.riena.sample.app.common/src/org/eclipse/riena/sample/app/common/model/IHelloWorldService.java
+++ b/org.eclipse.riena.sample.app.common/src/org/eclipse/riena/sample/app/common/model/IHelloWorldService.java
@@ -16,11 +16,6 @@ package org.eclipse.riena.sample.app.common.model;
public interface IHelloWorldService {
/**
- * Service ID
- */
- String ID = IHelloWorldService.class.getName();
-
- /**
* Receive a message from server.
*
* @return the message.
diff --git a/org.eclipse.riena.sample.app.server/src/org/eclipse/riena/internal/sample/app/server/Activator.java b/org.eclipse.riena.sample.app.server/src/org/eclipse/riena/internal/sample/app/server/Activator.java
index d194b1c..115ce7d 100644
--- a/org.eclipse.riena.sample.app.server/src/org/eclipse/riena/internal/sample/app/server/Activator.java
+++ b/org.eclipse.riena.sample.app.server/src/org/eclipse/riena/internal/sample/app/server/Activator.java
@@ -90,7 +90,7 @@ public class Activator extends Plugin {
properties.put(RSDPublisherProperties.PROP_REMOTE_PROTOCOL, REMOTE_PROTOCOL_HESSIAN);
properties.put(RSDPublisherProperties.PROP_REMOTE_PATH, "/CustomerSearchWS");
- regCustomerSearch = context.registerService(ICustomerSearch.ID, customers, properties);
+ regCustomerSearch = context.registerService(ICustomerSearch.class.getName(), customers, properties);
}
public void stopCustomerSearch() {
@@ -107,7 +107,7 @@ public class Activator extends Plugin {
properties.put(RSDPublisherProperties.PROP_REMOTE_PROTOCOL, REMOTE_PROTOCOL_HESSIAN);
properties.put(RSDPublisherProperties.PROP_REMOTE_PATH, "/CustomersWS");
- regCustomers = context.registerService(ICustomers.ID, customers, properties);
+ regCustomers = context.registerService(ICustomers.class.getName(), customers, properties);
}
public void stopCustomers() {
@@ -124,7 +124,8 @@ public class Activator extends Plugin {
properties.put(RSDPublisherProperties.PROP_REMOTE_PROTOCOL, REMOTE_PROTOCOL_HESSIAN);
properties.put(RSDPublisherProperties.PROP_REMOTE_PATH, "/HelloWorldServiceWS");
- regHelloWorldService = context.registerService(IHelloWorldService.ID, helloWorldService, properties);
+ regHelloWorldService = context.registerService(IHelloWorldService.class.getName(), helloWorldService,
+ properties);
}
public void stopHelloWorldService() {
diff --git a/org.eclipse.riena.security.common/src/org/eclipse/riena/internal/security/common/Activator.java b/org.eclipse.riena.security.common/src/org/eclipse/riena/internal/security/common/Activator.java
index 4e941b8..3d4a492 100644
--- a/org.eclipse.riena.security.common/src/org/eclipse/riena/internal/security/common/Activator.java
+++ b/org.eclipse.riena.security.common/src/org/eclipse/riena/internal/security/common/Activator.java
@@ -56,11 +56,12 @@ public class Activator extends Plugin {
super.start(context);
plugin = this;
CONTEXT = context;
- sessionHolderService = CONTEXT
- .registerService(ISessionHolderService.ID, new SimpleSessionHolderService(), null);
- securityCallHook = CONTEXT.registerService(ICallHook.ID, new SecurityCallHook(), null);
- principalHolderService = CONTEXT.registerService(ISubjectHolderService.ID, new SubjectHolderService(), null);
- permissionCache = CONTEXT.registerService(IPermissionCache.ID, new PermissionCache(), null);
+ sessionHolderService = CONTEXT.registerService(ISessionHolderService.class.getName(),
+ new SimpleSessionHolderService(), null);
+ securityCallHook = CONTEXT.registerService(ICallHook.class.getName(), new SecurityCallHook(), null);
+ principalHolderService = CONTEXT.registerService(ISubjectHolderService.class.getName(),
+ new SubjectHolderService(), null);
+ permissionCache = CONTEXT.registerService(IPermissionCache.class.getName(), new PermissionCache(), null);
RienaPolicy.init();
}
diff --git a/org.eclipse.riena.security.common/src/org/eclipse/riena/internal/security/common/SecurityCallHook.java b/org.eclipse.riena.security.common/src/org/eclipse/riena/internal/security/common/SecurityCallHook.java
index 3208c55..ac68236 100644
--- a/org.eclipse.riena.security.common/src/org/eclipse/riena/internal/security/common/SecurityCallHook.java
+++ b/org.eclipse.riena.security.common/src/org/eclipse/riena/internal/security/common/SecurityCallHook.java
@@ -32,7 +32,7 @@ public class SecurityCallHook implements ICallHook {
public SecurityCallHook() {
super();
- Inject.service(ISessionHolderService.ID).useRanking().into(this).andStart(Activator.getContext());
+ Inject.service(ISessionHolderService.class.getName()).useRanking().into(this).andStart(Activator.getContext());
}
public void bind(ISessionHolderService shService) {
diff --git a/org.eclipse.riena.security.common/src/org/eclipse/riena/security/common/ISubjectHolderService.java b/org.eclipse.riena.security.common/src/org/eclipse/riena/security/common/ISubjectHolderService.java
index 8046e04..f57e9b9 100644
--- a/org.eclipse.riena.security.common/src/org/eclipse/riena/security/common/ISubjectHolderService.java
+++ b/org.eclipse.riena.security.common/src/org/eclipse/riena/security/common/ISubjectHolderService.java
@@ -12,11 +12,6 @@ package org.eclipse.riena.security.common;
public interface ISubjectHolderService {
- /**
- * Service ID
- */
- String ID = ISubjectHolderService.class.getName();
-
- ISubjectHolder fetchSubjectHolder();
+ ISubjectHolder fetchSubjectHolder();
}
diff --git a/org.eclipse.riena.security.common/src/org/eclipse/riena/security/common/authentication/ClientLogin.java b/org.eclipse.riena.security.common/src/org/eclipse/riena/security/common/authentication/ClientLogin.java
index 4251f44..4062b7c 100644
--- a/org.eclipse.riena.security.common/src/org/eclipse/riena/security/common/authentication/ClientLogin.java
+++ b/org.eclipse.riena.security.common/src/org/eclipse/riena/security/common/authentication/ClientLogin.java
@@ -37,8 +37,8 @@ public class ClientLogin {
super();
this.loginContext = loginContext;
this.subject = subject;
- Inject.service(IAuthenticationService.ID).useRanking().into(this).andStart(Activator.getContext());
- Inject.service(ISubjectHolderService.ID).useRanking().into(this).andStart(Activator.getContext());
+ Inject.service(IAuthenticationService.class.getName()).useRanking().into(this).andStart(Activator.getContext());
+ Inject.service(ISubjectHolderService.class.getName()).useRanking().into(this).andStart(Activator.getContext());
}
public void bind(IAuthenticationService authenticationService) {
diff --git a/org.eclipse.riena.security.common/src/org/eclipse/riena/security/common/authentication/IAuthenticationService.java b/org.eclipse.riena.security.common/src/org/eclipse/riena/security/common/authentication/IAuthenticationService.java
index 571fae6..bd30af8 100644
--- a/org.eclipse.riena.security.common/src/org/eclipse/riena/security/common/authentication/IAuthenticationService.java
+++ b/org.eclipse.riena.security.common/src/org/eclipse/riena/security/common/authentication/IAuthenticationService.java
@@ -19,7 +19,6 @@ import org.eclipse.riena.security.common.session.Session;
*/
public interface IAuthenticationService {
- String ID = IAuthenticationService.class.getName();
String WS_ID = "/AuthenticationService";
/**
diff --git a/org.eclipse.riena.security.common/src/org/eclipse/riena/security/common/authorization/IAuthorizationService.java b/org.eclipse.riena.security.common/src/org/eclipse/riena/security/common/authorization/IAuthorizationService.java
index 95a2ca9..6770461 100644
--- a/org.eclipse.riena.security.common/src/org/eclipse/riena/security/common/authorization/IAuthorizationService.java
+++ b/org.eclipse.riena.security.common/src/org/eclipse/riena/security/common/authorization/IAuthorizationService.java
@@ -15,7 +15,6 @@ import java.security.Principal;
public interface IAuthorizationService {
- public String ID = IAuthorizationService.class.getName();
String WS_ID = "/AuthorizationService";
public Permissions[] getPermissions(Principal[] principals);
diff --git a/org.eclipse.riena.security.common/src/org/eclipse/riena/security/common/authorization/IPermissionCache.java b/org.eclipse.riena.security.common/src/org/eclipse/riena/security/common/authorization/IPermissionCache.java
index 8176290..bc46512 100644
--- a/org.eclipse.riena.security.common/src/org/eclipse/riena/security/common/authorization/IPermissionCache.java
+++ b/org.eclipse.riena.security.common/src/org/eclipse/riena/security/common/authorization/IPermissionCache.java
@@ -17,8 +17,6 @@ import javax.security.auth.Subject;
public interface IPermissionCache {
- public String ID = IPermissionCache.class.getName();
-
public Permissions getPermissions(Subject subject);
public Permissions getPermissions(Principal[] principals);
diff --git a/org.eclipse.riena.security.common/src/org/eclipse/riena/security/common/authorization/RienaPolicy.java b/org.eclipse.riena.security.common/src/org/eclipse/riena/security/common/authorization/RienaPolicy.java
index 87077a7..80ce69c 100644
--- a/org.eclipse.riena.security.common/src/org/eclipse/riena/security/common/authorization/RienaPolicy.java
+++ b/org.eclipse.riena.security.common/src/org/eclipse/riena/security/common/authorization/RienaPolicy.java
@@ -38,7 +38,7 @@ public class RienaPolicy extends Policy {
public RienaPolicy() {
super();
- Inject.service(IPermissionCache.ID).useRanking().into(this).andStart(Activator.getContext());
+ Inject.service(IPermissionCache.class.getName()).useRanking().into(this).andStart(Activator.getContext());
}
public void bind(IPermissionCache permCache) {
diff --git a/org.eclipse.riena.security.common/src/org/eclipse/riena/security/common/authorization/Sentinel.java b/org.eclipse.riena.security.common/src/org/eclipse/riena/security/common/authorization/Sentinel.java
index 29b7150..221de94 100644
--- a/org.eclipse.riena.security.common/src/org/eclipse/riena/security/common/authorization/Sentinel.java
+++ b/org.eclipse.riena.security.common/src/org/eclipse/riena/security/common/authorization/Sentinel.java
@@ -34,8 +34,8 @@ public class Sentinel {
private Sentinel() {
super();
- Inject.service(IPermissionCache.ID).useRanking().into(this).andStart(Activator.getContext());
- Inject.service(ISubjectHolderService.ID).useRanking().into(this).andStart(Activator.getContext());
+ Inject.service(IPermissionCache.class.getName()).useRanking().into(this).andStart(Activator.getContext());
+ Inject.service(ISubjectHolderService.class.getName()).useRanking().into(this).andStart(Activator.getContext());
}
public void bind(IPermissionCache permCache) {
diff --git a/org.eclipse.riena.security.common/src/org/eclipse/riena/security/common/authorization/internal/PermissionCache.java b/org.eclipse.riena.security.common/src/org/eclipse/riena/security/common/authorization/internal/PermissionCache.java
index 3597d08..4ad3c03 100644
--- a/org.eclipse.riena.security.common/src/org/eclipse/riena/security/common/authorization/internal/PermissionCache.java
+++ b/org.eclipse.riena.security.common/src/org/eclipse/riena/security/common/authorization/internal/PermissionCache.java
@@ -48,7 +48,7 @@ public class PermissionCache implements IPermissionCache {
permCache.setMinimumSize(100);
permCache.setTimeout(360000);
}
- Inject.service(IAuthorizationService.ID).useRanking().into(this).andStart(Activator.getContext());
+ Inject.service(IAuthorizationService.class.getName()).useRanking().into(this).andStart(Activator.getContext());
}
public void bind(IAuthorizationService authService) {
diff --git a/org.eclipse.riena.security.common/src/org/eclipse/riena/security/common/session/ISessionHolderService.java b/org.eclipse.riena.security.common/src/org/eclipse/riena/security/common/session/ISessionHolderService.java
index 64edb98..5cb342b 100644
--- a/org.eclipse.riena.security.common/src/org/eclipse/riena/security/common/session/ISessionHolderService.java
+++ b/org.eclipse.riena.security.common/src/org/eclipse/riena/security/common/session/ISessionHolderService.java
@@ -12,11 +12,6 @@ package org.eclipse.riena.security.common.session;
public interface ISessionHolderService {
- /**
- * Service ID
- */
- String ID = ISessionHolderService.class.getName();
-
- ISessionHolder fetchSessionHolder();
+ ISessionHolder fetchSessionHolder();
}
diff --git a/org.eclipse.riena.security.server/src/org/eclipse/riena/internal/security/server/Activator.java b/org.eclipse.riena.security.server/src/org/eclipse/riena/internal/security/server/Activator.java
index bec5c44..52a42c7 100644
--- a/org.eclipse.riena.security.server/src/org/eclipse/riena/internal/security/server/Activator.java
+++ b/org.eclipse.riena.security.server/src/org/eclipse/riena/internal/security/server/Activator.java
@@ -55,8 +55,9 @@ public class Activator extends Plugin {
principalCache.setName("principalCache");
Hashtable<String, String> props = new Hashtable<String, String>();
props.put("cache.type", "PrincipalCache");
- principalCacheRegistration = CONTEXT.registerService(IGenericObjectCache.ID, principalCache, props);
- securityServiceHook = CONTEXT.registerService(IServiceHook.ID, new SecurityServiceHook(), null);
+ principalCacheRegistration = CONTEXT
+ .registerService(IGenericObjectCache.class.getName(), principalCache, props);
+ securityServiceHook = CONTEXT.registerService(IServiceHook.class.getName(), new SecurityServiceHook(), null);
}
/*
diff --git a/org.eclipse.riena.security.server/src/org/eclipse/riena/internal/security/server/SecurityServiceHook.java b/org.eclipse.riena.security.server/src/org/eclipse/riena/internal/security/server/SecurityServiceHook.java
index f85564a..0ac65ee 100644
--- a/org.eclipse.riena.security.server/src/org/eclipse/riena/internal/security/server/SecurityServiceHook.java
+++ b/org.eclipse.riena.security.server/src/org/eclipse/riena/internal/security/server/SecurityServiceHook.java
@@ -68,11 +68,11 @@ public class SecurityServiceHook implements IServiceHook {
*/
public SecurityServiceHook() {
super();
- Inject.service(IGenericObjectCache.ID).useFilter("(cache.type=PrincipalCache)").into(this).andStart(
- Activator.getContext());
- Inject.service(ISessionService.ID).useRanking().into(this).andStart(Activator.getContext());
- Inject.service(ISubjectHolderService.ID).useRanking().into(this).andStart(Activator.getContext());
- Inject.service(ISessionHolderService.ID).useRanking().into(this).andStart(Activator.getContext());
+ Inject.service(IGenericObjectCache.class.getName()).useFilter("(cache.type=PrincipalCache)").into(this)
+ .andStart(Activator.getContext());
+ Inject.service(ISessionService.class.getName()).useRanking().into(this).andStart(Activator.getContext());
+ Inject.service(ISubjectHolderService.class.getName()).useRanking().into(this).andStart(Activator.getContext());
+ Inject.service(ISessionHolderService.class.getName()).useRanking().into(this).andStart(Activator.getContext());
// List<UnsecureWebservice> tempList =
// RegistryAccessor.fetchRegistry().getConfiguration(UNSECURE_WEBSERVICES_ID);
diff --git a/org.eclipse.riena.security.server/src/org/eclipse/riena/security/server/session/ISessionService.java b/org.eclipse.riena.security.server/src/org/eclipse/riena/security/server/session/ISessionService.java
index 19f21e2..6dfd9a2 100644
--- a/org.eclipse.riena.security.server/src/org/eclipse/riena/security/server/session/ISessionService.java
+++ b/org.eclipse.riena.security.server/src/org/eclipse/riena/security/server/session/ISessionService.java
@@ -24,7 +24,6 @@ import org.eclipse.riena.security.common.session.Session;
*/
public interface ISessionService {
- String ID = ISessionService.class.getName();
String WS_ID = "/SessionService";
/**
diff --git a/org.eclipse.riena.security.services/src/org/eclipse/riena/internal/security/authenticationservice/AuthenticationService.java b/org.eclipse.riena.security.services/src/org/eclipse/riena/internal/security/authenticationservice/AuthenticationService.java
index 5653837..1289ba6 100644
--- a/org.eclipse.riena.security.services/src/org/eclipse/riena/internal/security/authenticationservice/AuthenticationService.java
+++ b/org.eclipse.riena.security.services/src/org/eclipse/riena/internal/security/authenticationservice/AuthenticationService.java
@@ -72,11 +72,11 @@ public class AuthenticationService implements IAuthenticationService {
*/
public AuthenticationService() {
super();
- Inject.service(ISessionService.ID).useRanking().into(this).andStart(Activator.getContext());
- Inject.service(ISubjectHolderService.ID).useRanking().into(this).andStart(Activator.getContext());
+ Inject.service(ISessionService.class.getName()).useRanking().into(this).andStart(Activator.getContext());
+ Inject.service(ISubjectHolderService.class.getName()).useRanking().into(this).andStart(Activator.getContext());
// new
- // ServiceDescriptor(IAuthenticationModule.ID).injectInto(this).start(Activator.getContext());
- Inject.service(ISessionHolderService.ID).useRanking().into(this).andStart(Activator.getContext());
+ // ServiceDescriptor(IAuthenticationModule.class.getName()).injectInto(this).start(Activator.getContext());
+ Inject.service(ISessionHolderService.class.getName()).useRanking().into(this).andStart(Activator.getContext());
}
public void bind(ISessionService sessionService) {
diff --git a/org.eclipse.riena.security.services/src/org/eclipse/riena/internal/security/authorizationservice/AuthorizationService.java b/org.eclipse.riena.security.services/src/org/eclipse/riena/internal/security/authorizationservice/AuthorizationService.java
index d9da881..a59cc62 100644
--- a/org.eclipse.riena.security.services/src/org/eclipse/riena/internal/security/authorizationservice/AuthorizationService.java
+++ b/org.eclipse.riena.security.services/src/org/eclipse/riena/internal/security/authorizationservice/AuthorizationService.java
@@ -24,7 +24,7 @@ public class AuthorizationService implements IAuthorizationService {
public AuthorizationService() {
super();
- Inject.service(IPermissionStore.ID).useRanking().into(this).andStart(Activator.getContext());
+ Inject.service(IPermissionStore.class.getName()).useRanking().into(this).andStart(Activator.getContext());
}
public void bind(IPermissionStore permStore) {
diff --git a/org.eclipse.riena.security.services/src/org/eclipse/riena/internal/security/services/Activator.java b/org.eclipse.riena.security.services/src/org/eclipse/riena/internal/security/services/Activator.java
index 48ac075..0603972 100644
--- a/org.eclipse.riena.security.services/src/org/eclipse/riena/internal/security/services/Activator.java
+++ b/org.eclipse.riena.security.services/src/org/eclipse/riena/internal/security/services/Activator.java
@@ -51,24 +51,28 @@ public class Activator extends RienaActivator {
properties.put("riena.remote", Boolean.TRUE.toString());
properties.put("riena.remote.protocol", "hessian");
properties.put("riena.remote.path", IAuthenticationService.WS_ID);
- authenticationService = getContext().registerService(IAuthenticationService.ID, new AuthenticationService(), properties);
+ authenticationService = getContext().registerService(IAuthenticationService.class.getName(),
+ new AuthenticationService(), properties);
// register SessionService
properties = ServiceDescriptor.newDefaultServiceProperties();
properties.put("riena.remote", Boolean.TRUE.toString());
properties.put("riena.remote.protocol", "hessian");
properties.put("riena.remote.path", ISessionService.WS_ID);
- sessionService = getContext().registerService(ISessionService.ID, new SessionService(), properties);
+ sessionService = getContext()
+ .registerService(ISessionService.class.getName(), new SessionService(), properties);
// register AuthorizationService
properties = ServiceDescriptor.newDefaultServiceProperties();
properties.put("riena.remote", Boolean.TRUE.toString());
properties.put("riena.remote.protocol", "hessian");
properties.put("riena.remote.path", IAuthorizationService.WS_ID);
- authorizationService = getContext().registerService(IAuthorizationService.ID, new AuthorizationService(), properties);
+ authorizationService = getContext().registerService(IAuthorizationService.class.getName(),
+ new AuthorizationService(), properties);
// register SessionProvider
- sessionProvider = getContext().registerService(ISessionProvider.ID, new SessionProvider(), ServiceDescriptor.newDefaultServiceProperties());
+ sessionProvider = getContext().registerService(ISessionProvider.class.getName(), new SessionProvider(),
+ ServiceDescriptor.newDefaultServiceProperties());
}
diff --git a/org.eclipse.riena.security.services/src/org/eclipse/riena/internal/security/sessionservice/SessionService.java b/org.eclipse.riena.security.services/src/org/eclipse/riena/internal/security/sessionservice/SessionService.java
index a994e12..cb0e013 100644
--- a/org.eclipse.riena.security.services/src/org/eclipse/riena/internal/security/sessionservice/SessionService.java
+++ b/org.eclipse.riena.security.services/src/org/eclipse/riena/internal/security/sessionservice/SessionService.java
@@ -36,8 +36,8 @@ public class SessionService implements ISessionService {
*/
public SessionService() {
super();
- Inject.service(ISessionStore.ID).into(this).andStart(Activator.getContext());
- Inject.service(ISessionProvider.ID).into(this).andStart(Activator.getContext());
+ Inject.service(ISessionStore.class.getName()).into(this).andStart(Activator.getContext());
+ Inject.service(ISessionProvider.class.getName()).into(this).andStart(Activator.getContext());
}
public void bind(ISessionStore store) {
diff --git a/org.eclipse.riena.security.services/src/org/eclipse/riena/security/authorizationservice/IPermissionStore.java b/org.eclipse.riena.security.services/src/org/eclipse/riena/security/authorizationservice/IPermissionStore.java
index 1923037..1a70b22 100644
--- a/org.eclipse.riena.security.services/src/org/eclipse/riena/security/authorizationservice/IPermissionStore.java
+++ b/org.eclipse.riena.security.services/src/org/eclipse/riena/security/authorizationservice/IPermissionStore.java
@@ -18,8 +18,6 @@ import java.security.Principal;
*/
public interface IPermissionStore {
- public static String ID = IPermissionStore.class.getName();
-
/**
* Loads the permissions for one principal
*
diff --git a/org.eclipse.riena.security.services/src/org/eclipse/riena/security/sessionservice/ISessionProvider.java b/org.eclipse.riena.security.services/src/org/eclipse/riena/security/sessionservice/ISessionProvider.java
index 49f8176..6bf4111 100644
--- a/org.eclipse.riena.security.services/src/org/eclipse/riena/security/sessionservice/ISessionProvider.java
+++ b/org.eclipse.riena.security.services/src/org/eclipse/riena/security/sessionservice/ISessionProvider.java
@@ -14,26 +14,25 @@ import java.security.Principal;
import org.eclipse.riena.security.common.session.Session;
-
/**
- * This Provider allows to supply your own implementation to construct the <code>Session</code> object. See comment
- * below. You always have to construct the <code>Session</code> object, however you can bring in your own algorithm
- * for supplying the ID.
+ * This Provider allows to supply your own implementation to construct the
+ * <code>Session</code> object. See comment below. You always have to
+ * construct the <code>Session</code> object, however you can bring in your
+ * own algorithm for supplying the ID.
*
*/
public interface ISessionProvider {
- String ID = ISessionProvider.class.getName();
-
- /**
- * The interface should allow to return any instance of the interface <code>ISession</code>. However other parts
- * of the Framework construct explicit the Session from the id. Hence only the original Session Implementation is
- * currently allowed.
- *
- * @param principals
- * @param principalLocation
- * @return session
- */
- Session createSession(Principal[] principals);
+ /**
+ * The interface should allow to return any instance of the interface
+ * <code>ISession</code>. However other parts of the Framework construct
+ * explicit the Session from the id. Hence only the original Session
+ * Implementation is currently allowed.
+ *
+ * @param principals
+ * @param principalLocation
+ * @return session
+ */
+ Session createSession(Principal[] principals);
} \ No newline at end of file
diff --git a/org.eclipse.riena.security.services/src/org/eclipse/riena/security/sessionservice/ISessionStore.java b/org.eclipse.riena.security.services/src/org/eclipse/riena/security/sessionservice/ISessionStore.java
index 8fd5893..8e26775 100644
--- a/org.eclipse.riena.security.services/src/org/eclipse/riena/security/sessionservice/ISessionStore.java
+++ b/org.eclipse.riena.security.services/src/org/eclipse/riena/security/sessionservice/ISessionStore.java
@@ -20,8 +20,6 @@ import org.eclipse.riena.security.common.session.Session;
*/
public interface ISessionStore {
- String ID = ISessionStore.class.getName();
-
/** <code>SESSION_STORE_ID</code> */
String SESSION_STORE_ID = "spirit.securityimplementation.server.SessionStore";
diff --git a/org.eclipse.riena.security.simpleservices/src/org/eclipse/riena/internal/security/simpleservices/Activator.java b/org.eclipse.riena.security.simpleservices/src/org/eclipse/riena/internal/security/simpleservices/Activator.java
index be11a1e..cc71f94 100644
--- a/org.eclipse.riena.security.simpleservices/src/org/eclipse/riena/internal/security/simpleservices/Activator.java
+++ b/org.eclipse.riena.security.simpleservices/src/org/eclipse/riena/internal/security/simpleservices/Activator.java
@@ -39,12 +39,14 @@ public class Activator extends RienaActivator {
super.start(context);
plugin = this;
// bring up a simple in memory session store
- memoryStore = getContext().registerService(ISessionStore.ID, new MemoryStore(), ServiceDescriptor.newDefaultServiceProperties());
+ memoryStore = getContext().registerService(ISessionStore.class.getName(), new MemoryStore(),
+ ServiceDescriptor.newDefaultServiceProperties());
// bring up a simple authorization store for permissions
InputStream inputStream = this.getClass().getResourceAsStream("policy-def.xml");
FilePermissionStore store = new FilePermissionStore(inputStream);
- filepermissionstore = context.registerService(IPermissionStore.ID, store, ServiceDescriptor.newDefaultServiceProperties());
+ filepermissionstore = context.registerService(IPermissionStore.class.getName(), store, ServiceDescriptor
+ .newDefaultServiceProperties());
}
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/core/exception/ExceptionHandlerManagerTest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/core/exception/ExceptionHandlerManagerTest.java
index 521b736..6229489 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/core/exception/ExceptionHandlerManagerTest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/core/exception/ExceptionHandlerManagerTest.java
@@ -31,7 +31,7 @@ public class ExceptionHandlerManagerTest extends RienaTestCase {
public void testGetManager() {
BundleContext context = getContext();
- ServiceReference managerRef = context.getServiceReference(IExceptionHandlerManager.ID);
+ ServiceReference managerRef = context.getServiceReference(IExceptionHandlerManager.class.getName());
Assert.assertNotNull(managerRef);
IExceptionHandlerManager manager = (IExceptionHandlerManager) context.getService(managerRef);
@@ -45,9 +45,9 @@ public class ExceptionHandlerManagerTest extends RienaTestCase {
test.name = "test.scp.handler1";
Hashtable<String, String> properties = new Hashtable<String, String>(0);
- context.registerService(IExceptionHandler.ID, test, properties);
+ context.registerService(IExceptionHandler.class.getName(), test, properties);
- ServiceReference managerRef = context.getServiceReference(IExceptionHandlerManager.ID);
+ ServiceReference managerRef = context.getServiceReference(IExceptionHandlerManager.class.getName());
Assert.assertNotNull(managerRef);
IExceptionHandlerManager manager = (IExceptionHandlerManager) context.getService(managerRef);
@@ -65,7 +65,7 @@ public class ExceptionHandlerManagerTest extends RienaTestCase {
test1.name = "test.scp.handler1";
Hashtable<String, String> properties = new Hashtable<String, String>(0);
- context.registerService(IExceptionHandler.ID, test1, properties);
+ context.registerService(IExceptionHandler.class.getName(), test1, properties);
TestExceptionHandler test2 = new TestExceptionHandler();
test2.name = "test.scp.handler2";
@@ -73,9 +73,9 @@ public class ExceptionHandlerManagerTest extends RienaTestCase {
test2.action = IExceptionHandlerManager.Action.Ok;
properties = new Hashtable<String, String>(0);
- context.registerService(IExceptionHandler.ID, test2, properties);
+ context.registerService(IExceptionHandler.class.getName(), test2, properties);
- ServiceReference managerRef = context.getServiceReference(IExceptionHandlerManager.ID);
+ ServiceReference managerRef = context.getServiceReference(IExceptionHandlerManager.class.getName());
Assert.assertNotNull(managerRef);
IExceptionHandlerManager manager = (IExceptionHandlerManager) context.getService(managerRef);
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/security/authorizationservice/AuthorizationTest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/security/authorizationservice/AuthorizationTest.java
index 404f78f..fae3bf1 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/security/authorizationservice/AuthorizationTest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/security/authorizationservice/AuthorizationTest.java
@@ -35,8 +35,8 @@ public class AuthorizationTest extends RienaTestCase {
// permissions for this test TODO
InputStream inputStream = this.getClass().getResourceAsStream("policy-def-test.xml"); //$NON-NLS-1$
FilePermissionStore store = new FilePermissionStore(inputStream);
- fileStoreReg = getContext().registerService(IPermissionStore.ID, store, null);
- ServiceReference ref = getContext().getServiceReference(IAuthorizationService.ID);
+ fileStoreReg = getContext().registerService(IPermissionStore.class.getName(), store, null);
+ ServiceReference ref = getContext().getServiceReference(IAuthorizationService.class.getName());
// if (ref != null) {
// ref.getBundle().stop();
// }
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/security/authorizationservice/SentinelTest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/security/authorizationservice/SentinelTest.java
index c899fcc..1a39626 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/security/authorizationservice/SentinelTest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/security/authorizationservice/SentinelTest.java
@@ -45,13 +45,13 @@ public class SentinelTest extends RienaTestCase {
// permissions for this test TODO
InputStream inputStream = this.getClass().getResourceAsStream("policy-def-test.xml"); //$NON-NLS-1$
FilePermissionStore store = new FilePermissionStore(inputStream);
- fileStoreReg = getContext().registerService(IPermissionStore.ID, store, null);
- ServiceReference ref = getContext().getServiceReference(IAuthorizationService.ID);
+ fileStoreReg = getContext().registerService(IPermissionStore.class.getName(), store, null);
+ ServiceReference ref = getContext().getServiceReference(IAuthorizationService.class.getName());
if (ref != null) {
ref.getBundle().stop();
}
- authorizationServiceReg = getContext().registerService(IAuthorizationService.ID, new AuthorizationService(),
- null);
+ authorizationServiceReg = getContext().registerService(IAuthorizationService.class.getName(),
+ new AuthorizationService(), null);
}
/*
@@ -74,7 +74,7 @@ public class SentinelTest extends RienaTestCase {
Subject subject = new Subject();
subject.getPrincipals().add(new SimplePrincipal("testuser"));
ISubjectHolderService subjectHolderService = (ISubjectHolderService) getContext().getService(
- getContext().getServiceReference(ISubjectHolderService.ID));
+ getContext().getServiceReference(ISubjectHolderService.class.getName()));
subjectHolderService.fetchSubjectHolder().setSubject(subject);
boolean result = Sentinel.checkAccess(new TestcasePermission("testPerm"));
@@ -85,7 +85,7 @@ public class SentinelTest extends RienaTestCase {
Subject subject = new Subject();
subject.getPrincipals().add(new SimplePrincipal("anotheruser"));
ISubjectHolderService subjectHolderService = (ISubjectHolderService) getContext().getService(
- getContext().getServiceReference(ISubjectHolderService.ID));
+ getContext().getServiceReference(ISubjectHolderService.class.getName()));
subjectHolderService.fetchSubjectHolder().setSubject(subject);
boolean result = Sentinel.checkAccess(new TestcasePermission("testPerm"));
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/security/services/itest/authentication/AuthenticationClientITest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/security/services/itest/authentication/AuthenticationClientITest.java
index 3c3dc14..6764cfd 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/security/services/itest/authentication/AuthenticationClientITest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/security/services/itest/authentication/AuthenticationClientITest.java
@@ -71,7 +71,7 @@ public class AuthenticationClientITest extends RienaTestCase {
public void testLogin() throws Exception {
trace("Looking up Authentication Service...: ");
- ServiceReference ref = getContext().getServiceReference(IAuthenticationService.ID);
+ ServiceReference ref = getContext().getServiceReference(IAuthenticationService.class.getName());
IAuthenticationService authenticationService = (IAuthenticationService) getContext().getService(ref);
trace("Service looked up: " + authenticationService.getClass().getName());
@@ -104,7 +104,7 @@ public class AuthenticationClientITest extends RienaTestCase {
public void testInvalidLogin() throws Exception {
try {
- ServiceReference ref = getContext().getServiceReference(IAuthenticationService.ID);
+ ServiceReference ref = getContext().getServiceReference(IAuthenticationService.class.getName());
IAuthenticationService authenticationService = (IAuthenticationService) getContext().getService(ref);
AbstractCredential[] creds = new AbstractCredential[2];
NameCredential nc = new NameCredential("username: ", "xx");
@@ -121,7 +121,7 @@ public class AuthenticationClientITest extends RienaTestCase {
}
public void testSubjectLogin() throws Exception {
- ServiceReference ref = getContext().getServiceReference(IAuthenticationService.ID);
+ ServiceReference ref = getContext().getServiceReference(IAuthenticationService.class.getName());
IAuthenticationService authenticationService = (IAuthenticationService) getContext().getService(ref);
trace("Service looked up: " + authenticationService.getClass().getName());
@@ -141,7 +141,7 @@ public class AuthenticationClientITest extends RienaTestCase {
for (Principal p : ticket.getPrincipals()) {
subject.getPrincipals().add(p);
}
- ServiceReference ref2 = getContext().getServiceReference(ISubjectHolderService.ID);
+ ServiceReference ref2 = getContext().getServiceReference(ISubjectHolderService.class.getName());
ISubjectHolderService subHolderService = (ISubjectHolderService) getContext().getService(ref2);
subHolderService.fetchSubjectHolder().setSubject(subject);
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/security/services/itest/authentication/AuthenticationLoginModuleITest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/security/services/itest/authentication/AuthenticationLoginModuleITest.java
index b807616..21d242b 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/security/services/itest/authentication/AuthenticationLoginModuleITest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/security/services/itest/authentication/AuthenticationLoginModuleITest.java
@@ -56,12 +56,12 @@ public class AuthenticationLoginModuleITest extends RienaTestCase {
public void testRemoteLogin() throws LoginException {
LoginContext lc = new LoginContext("Remote", new MyCallbackHandler("testuser", "testpass"));
lc.login();
- ServiceReference ref = getContext().getServiceReference(IAuthenticationService.ID);
+ ServiceReference ref = getContext().getServiceReference(IAuthenticationService.class.getName());
IAuthenticationService as = (IAuthenticationService) getContext().getService(ref);
System.out.println("subject:" + lc.getSubject());
System.out.println("login in sucessful");
ISessionHolderService shs = (ISessionHolderService) getContext().getService(
- getContext().getServiceReference(ISessionHolderService.ID));
+ getContext().getServiceReference(ISessionHolderService.class.getName()));
as.logout(shs.fetchSessionHolder().getSession());
System.out.println("logoff sucessful");
}
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/security/services/itest/authorization/AuthorizationServiceITest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/security/services/itest/authorization/AuthorizationServiceITest.java
index 14c19b3..441a9e7 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/security/services/itest/authorization/AuthorizationServiceITest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/security/services/itest/authorization/AuthorizationServiceITest.java
@@ -62,16 +62,16 @@ public class AuthorizationServiceITest extends RienaTestCase {
public void testLoginWithUserWithRights() throws Exception {
LoginContext lc = new LoginContext("Remote", new MyCallbackHandler("testuser", "testpass"));
lc.login();
- ServiceReference ref = getContext().getServiceReference(IAuthenticationService.ID);
+ ServiceReference ref = getContext().getServiceReference(IAuthenticationService.class.getName());
IAuthenticationService as = (IAuthenticationService) getContext().getService(ref);
System.out.println("subject:" + lc.getSubject());
System.out.println("login in sucessful");
ISessionHolderService shs = (ISessionHolderService) getContext().getService(
- getContext().getServiceReference(ISessionHolderService.ID));
+ getContext().getServiceReference(ISessionHolderService.class.getName()));
// call the customerService
ICustomerSearch cs = (ICustomerSearch) getContext().getService(
- getContext().getServiceReference(ICustomerSearch.ID));
+ getContext().getServiceReference(ICustomerSearch.class.getName()));
Customer cust = new Customer();
cust.setLastName("Solo");
cust.setFirstName("Han");
@@ -88,17 +88,17 @@ public class AuthorizationServiceITest extends RienaTestCase {
public void testLoginWithUserWithoutRights() throws Exception {
LoginContext lc = new LoginContext("Remote", new MyCallbackHandler("testuser2", "testpass2"));
lc.login();
- ServiceReference ref = getContext().getServiceReference(IAuthenticationService.ID);
+ ServiceReference ref = getContext().getServiceReference(IAuthenticationService.class.getName());
IAuthenticationService as = (IAuthenticationService) getContext().getService(ref);
System.out.println("subject:" + lc.getSubject());
System.out.println("login in sucessful");
ISessionHolderService shs = (ISessionHolderService) getContext().getService(
- getContext().getServiceReference(ISessionHolderService.ID));
+ getContext().getServiceReference(ISessionHolderService.class.getName()));
try {
// call the customerService
ICustomerSearch cs = (ICustomerSearch) getContext().getService(
- getContext().getServiceReference(ICustomerSearch.ID));
+ getContext().getServiceReference(ICustomerSearch.class.getName()));
Customer cust = new Customer();
cust.setLastName("Solo");
cust.setFirstName("Han");
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/security/services/itest/session/SessionServiceITest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/security/services/itest/session/SessionServiceITest.java
index cf79b31..6f3efe2 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/security/services/itest/session/SessionServiceITest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/security/services/itest/session/SessionServiceITest.java
@@ -60,7 +60,7 @@ public class SessionServiceITest extends RienaTestCase {
* @throws Exception
*/
public void testController1() throws Exception {
- ServiceReference ref = getContext().getServiceReference(ISessionService.ID);
+ ServiceReference ref = getContext().getServiceReference(ISessionService.class.getName());
ISessionService sessionService = (ISessionService) getContext().getService(ref);
assertNotNull("SessionControllerAccessor returns null", sessionService);
Session session = sessionService.generateSession(new Principal[] { new SimplePrincipal("testuid") });
@@ -124,7 +124,7 @@ public class SessionServiceITest extends RienaTestCase {
private int loopCounter;
Threader(int loopCounter) {
- ServiceReference ref = getContext().getServiceReference(ISessionService.ID);
+ ServiceReference ref = getContext().getServiceReference(ISessionService.class.getName());
sessionService = (ISessionService) getContext().getService(ref);
this.loopCounter = loopCounter;
assertNotNull("SessionServiceAccessor returns null", sessionService);