syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fmarte...@apache.org
Subject [16/28] syncope git commit: [SYNCOPE-156] Removing (most of) Spring from console
Date Fri, 30 Oct 2015 11:42:23 GMT
[SYNCOPE-156] Removing (most of) Spring from console


Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/13f96e06
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/13f96e06
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/13f96e06

Branch: refs/heads/master
Commit: 13f96e06804f0574a72cf2d496cb2ac62f927847
Parents: 07b519b
Author: Francesco Chicchiriccò <ilgrosso@apache.org>
Authored: Tue Oct 6 17:50:44 2015 +0200
Committer: Francesco Chicchiriccò <ilgrosso@apache.org>
Committed: Tue Oct 6 17:50:44 2015 +0200

----------------------------------------------------------------------
 client/console/pom.xml                          |   8 +-
 .../client/console/PreferenceManager.java       |  10 +-
 .../console/SyncopeConsoleApplication.java      | 127 +++++++++++++++----
 .../client/console/SyncopeConsoleSession.java   |  47 ++-----
 .../client/console/commons/PreviewUtils.java    |  44 +++++--
 .../init/ClassPathScanImplementationLookup.java | 109 ++++++++++++++++
 .../client/console/init/ConsoleInitializer.java |  52 +++-----
 .../init/ImplementationClassNamesLoader.java    | 105 ---------------
 .../client/console/init/MIMETypesLoader.java    |  15 +--
 .../console/init/SyncopeConsoleLoader.java      |  35 -----
 .../client/console/pages/AbstractBasePage.java  |  41 ------
 .../syncope/client/console/pages/BasePage.java  |   7 +-
 .../pages/DisplayAttributesModalPage.java       |   4 +-
 .../syncope/client/console/pages/Login.java     |   6 +-
 .../console/pages/MustChangePassword.java       |   4 +-
 .../console/pages/ProvisioningModalPage.java    |   9 ++
 .../syncope/client/console/pages/Realms.java    |   4 +-
 .../client/console/pages/ResultStatusModal.java |   6 +-
 .../client/console/pages/StatusModalPage.java   |  19 ++-
 .../syncope/client/console/pages/Workflow.java  |  11 +-
 .../console/pages/XMLEditorPopupPage.java       |   4 +-
 .../console/panels/AbstractModalPanel.java      |  41 ------
 .../panels/AbstractSearchResultPanel.java       |   7 +-
 .../console/panels/AnySearchResultPanel.java    |   9 +-
 .../client/console/panels/ConnectorModal.java   |   3 +
 .../client/console/panels/GroupModalPanel.java  |   4 +
 .../syncope/client/console/panels/Realm.java    |  15 +--
 .../client/console/panels/RealmModalPanel.java  |   9 +-
 .../console/panels/RealmSidebarPanel.java       |   4 +-
 .../console/panels/ResourceConnConfPanel.java   |   4 +-
 .../console/panels/ResourceMappingPanel.java    |   7 +-
 .../client/console/panels/ResourceModal.java    |  14 +-
 .../console/panels/ResourceSecurityPanel.java   |   4 +-
 .../resources/WorkflowDefGETResource.java       |   7 +-
 .../resources/WorkflowDefPUTResource.java       |   6 +-
 .../client/console/rest/BaseRestClient.java     |   3 +-
 .../client/console/topology/Topology.java       |  14 +-
 .../console/topology/TopologyNodePanel.java     |  20 ++-
 .../markup/html/form/BinaryFieldPanel.java      |  15 +--
 .../html/list/ConnConfPropertyListView.java     |   9 +-
 .../main/resources/META-INF/web-fragment.xml    |  16 +--
 .../src/main/resources/console.properties       |   9 ++
 .../src/main/resources/consoleContext.xml       |  71 -----------
 .../java/data/UserDataBinderImpl.java           |   1 -
 .../console/pages/CamelRouteModalPage.java      |   6 +-
 .../client/console/panels/CamelRoutePanel.java  |   4 +-
 fit/console-reference/pom.xml                   |   2 +-
 .../src/main/resources/console.properties       |   9 ++
 pom.xml                                         |  13 +-
 49 files changed, 420 insertions(+), 573 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/syncope/blob/13f96e06/client/console/pom.xml
----------------------------------------------------------------------
diff --git a/client/console/pom.xml b/client/console/pom.xml
index fb78280..24f6288 100644
--- a/client/console/pom.xml
+++ b/client/console/pom.xml
@@ -46,9 +46,9 @@ under the License.
 
     <dependency>
       <groupId>org.springframework</groupId>
-      <artifactId>spring-web</artifactId>
+      <artifactId>spring-context</artifactId>
     </dependency>
-
+      
     <dependency>
       <groupId>org.apache.wicket</groupId>
       <artifactId>wicket</artifactId>
@@ -64,10 +64,6 @@ under the License.
     </dependency>
     <dependency>
       <groupId>org.apache.wicket</groupId>
-      <artifactId>wicket-spring</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.wicket</groupId>
       <artifactId>wicket-auth-roles</artifactId>
     </dependency>
     <dependency>

http://git-wip-us.apache.org/repos/asf/syncope/blob/13f96e06/client/console/src/main/java/org/apache/syncope/client/console/PreferenceManager.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/PreferenceManager.java b/client/console/src/main/java/org/apache/syncope/client/console/PreferenceManager.java
index 381fc65..c7baef2 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/PreferenceManager.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/PreferenceManager.java
@@ -27,6 +27,7 @@ import java.util.Arrays;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.math.NumberUtils;
 import org.apache.wicket.request.Request;
 import org.apache.wicket.request.Response;
@@ -35,7 +36,6 @@ import org.apache.wicket.util.cookies.CookieUtils;
 import org.apache.wicket.util.crypt.Base64;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.springframework.util.StringUtils;
 
 public class PreferenceManager {
 
@@ -69,7 +69,7 @@ public class PreferenceManager {
     private Map<String, String> getPrefs(final String value) {
         Map<String, String> prefs;
         try {
-            if (StringUtils.hasText(value)) {
+            if (StringUtils.isNotBlank(value)) {
                 prefs = mapper.readValue(value, MAP_TYPE_REF);
             } else {
                 throw new Exception("Invalid cookie value '" + value + "'");
@@ -117,7 +117,7 @@ public class PreferenceManager {
 
         final String compound = get(request, key);
 
-        if (StringUtils.hasText(compound)) {
+        if (StringUtils.isNotBlank(compound)) {
             String[] items = compound.split(";");
             result.addAll(Arrays.asList(items));
         }
@@ -135,7 +135,7 @@ public class PreferenceManager {
 
         // after retrieved previous setting in order to overwrite the key ...
         for (Map.Entry<String, List<String>> entry : prefs.entrySet()) {
-            current.put(entry.getKey(), StringUtils.collectionToDelimitedString(entry.getValue(), ";"));
+            current.put(entry.getKey(), StringUtils.join(entry.getValue(), ";"));
         }
 
         try {
@@ -164,7 +164,7 @@ public class PreferenceManager {
     }
 
     public void setList(final Request request, final Response response, final String key, final List<String> values) {
-        set(request, response, key, StringUtils.collectionToDelimitedString(values, ";"));
+        set(request, response, key, StringUtils.join(values, ";"));
     }
 
     public void setList(final Request request, final Response response, final Map<String, List<String>> prefs) {

http://git-wip-us.apache.org/repos/asf/syncope/blob/13f96e06/client/console/src/main/java/org/apache/syncope/client/console/SyncopeConsoleApplication.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/SyncopeConsoleApplication.java b/client/console/src/main/java/org/apache/syncope/client/console/SyncopeConsoleApplication.java
index e9f35ec..ec65024 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/SyncopeConsoleApplication.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/SyncopeConsoleApplication.java
@@ -22,11 +22,16 @@ import de.agilecoders.wicket.core.Bootstrap;
 import de.agilecoders.wicket.core.settings.BootstrapSettings;
 import de.agilecoders.wicket.core.settings.IBootstrapSettings;
 import de.agilecoders.wicket.core.settings.SingleThemeProvider;
+import java.io.File;
 import java.util.Arrays;
 import java.util.Collections;
 import java.util.List;
 import java.util.Locale;
-import org.apache.commons.lang3.StringUtils;
+import java.util.Properties;
+import javax.ws.rs.core.MediaType;
+import org.apache.commons.io.FileUtils;
+import org.apache.syncope.client.console.init.ClassPathScanImplementationLookup;
+import org.apache.syncope.client.console.init.ConsoleInitializer;
 import org.apache.syncope.client.console.pages.BasePage;
 import org.apache.syncope.client.console.pages.MustChangePassword;
 import org.apache.syncope.client.console.pages.Dashboard;
@@ -35,8 +40,10 @@ import org.apache.syncope.client.console.resources.FilesystemResource;
 import org.apache.syncope.client.console.resources.WorkflowDefGETResource;
 import org.apache.syncope.client.console.resources.WorkflowDefPUTResource;
 import org.apache.syncope.client.console.themes.AdminLTE;
+import org.apache.syncope.client.lib.SyncopeClientFactoryBean;
 import org.apache.syncope.common.lib.types.Entitlement;
 import org.apache.wicket.Page;
+import org.apache.wicket.WicketRuntimeException;
 import org.apache.wicket.authroles.authentication.AbstractAuthenticatedWebSession;
 import org.apache.wicket.authroles.authentication.AuthenticatedWebApplication;
 import org.apache.wicket.authroles.authentication.AuthenticatedWebSession;
@@ -46,19 +53,16 @@ import org.apache.wicket.protocol.http.WebApplication;
 import org.apache.wicket.request.resource.IResource;
 import org.apache.wicket.request.resource.ResourceReference;
 import org.apache.wicket.resource.DynamicJQueryResourceReference;
-import org.apache.wicket.spring.injection.annot.SpringComponentInjector;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.config.BeanDefinition;
-import org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider;
-import org.springframework.core.type.filter.AssignableTypeFilter;
-import org.springframework.util.ClassUtils;
-import org.springframework.web.context.support.WebApplicationContextUtils;
+import org.springframework.util.Assert;
 
 public class SyncopeConsoleApplication extends AuthenticatedWebApplication {
 
     private static final Logger LOG = LoggerFactory.getLogger(SyncopeConsoleApplication.class);
 
+    private static final String CONSOLE_PROPERTIES = "console.properties";
+
     public static final List<Locale> SUPPORTED_LOCALES = Collections.unmodifiableList(Arrays.asList(
             new Locale[] {
                 Locale.ENGLISH, Locale.ITALIAN, new Locale("pt", "BR")
@@ -66,10 +70,65 @@ public class SyncopeConsoleApplication extends AuthenticatedWebApplication {
 
     private static final String ACTIVITI_MODELER_CONTEXT = "activiti-modeler";
 
+    public static SyncopeConsoleApplication get() {
+        return (SyncopeConsoleApplication) WebApplication.get();
+    }
+
+    private String version;
+
+    private String site;
+
+    private String license;
+
+    private String anonymousUser;
+
+    private String anonymousKey;
+
+    private String activitiModelerDirectory;
+
+    private SyncopeClientFactoryBean clientFactory;
+
     @Override
     protected void init() {
         super.init();
 
+        // read console.properties
+        Properties props = new Properties();
+        try {
+            props.load(getClass().getResourceAsStream("/" + CONSOLE_PROPERTIES));
+            File consoleDir = new File(props.getProperty("console.directory"));
+            if (consoleDir.exists() && consoleDir.canRead() && consoleDir.isDirectory()) {
+                File consoleDirProps = FileUtils.getFile(consoleDir, CONSOLE_PROPERTIES);
+                if (consoleDirProps.exists() && consoleDirProps.canRead() && consoleDirProps.isFile()) {
+                    props.clear();
+                    props.load(FileUtils.openInputStream(consoleDir));
+                }
+            }
+        } catch (Exception e) {
+            throw new WicketRuntimeException("Could not read " + CONSOLE_PROPERTIES, e);
+        }
+        version = props.getProperty("version");
+        Assert.notNull(version, "<version> not set");
+        site = props.getProperty("site");
+        Assert.notNull(site, "<site> not set");
+        license = props.getProperty("license");
+        Assert.notNull(license, "<license> not set");
+        anonymousUser = props.getProperty("anonymousUser");
+        Assert.notNull(anonymousUser, "<anonymousUser> not set");
+        anonymousKey = props.getProperty("anonymousKey");
+        Assert.notNull(anonymousKey, "<anonymousKey> not set");
+
+        String scheme = props.getProperty("scheme");
+        Assert.notNull(scheme, "<scheme> not set");
+        String host = props.getProperty("host");
+        Assert.notNull(host, "<host> not set");
+        String port = props.getProperty("port");
+        Assert.notNull(port, "<port> not set");
+        String rootPath = props.getProperty("rootPath");
+        Assert.notNull(rootPath, "<rootPath> not set");
+
+        clientFactory = new SyncopeClientFactoryBean().setAddress(scheme + "://" + host + ":" + port + "/" + rootPath);
+
         // Application settings
         IBootstrapSettings settings = new BootstrapSettings();
 
@@ -81,24 +140,16 @@ public class SyncopeConsoleApplication extends AuthenticatedWebApplication {
 
         getResourceSettings().setUseMinifiedResources(true);
 
-        getComponentInstantiationListeners().add(new SpringComponentInjector(this));
         getResourceSettings().setThrowExceptionOnMissingResource(true);
 
         getJavaScriptLibrarySettings().setJQueryReference(new DynamicJQueryResourceReference());
 
         getSecuritySettings().setAuthorizationStrategy(new MetaDataRoleAuthorizationStrategy(this));
-        ClassPathScanningCandidateComponentProvider scanner = new ClassPathScanningCandidateComponentProvider(false);
-        scanner.addIncludeFilter(new AssignableTypeFilter(BasePage.class));
-
-        for (BeanDefinition bd : scanner.findCandidateComponents(StringUtils.EMPTY)) {
-            try {
-                @SuppressWarnings("unchecked")
-                Class<? extends BasePage> clazz = (Class<? extends BasePage>) ClassUtils.resolveClassName(
-                        bd.getBeanClassName(), ClassUtils.getDefaultClassLoader());
-                MetaDataRoleAuthorizationStrategy.authorize(clazz, SyncopeConsoleSession.AUTHENTICATED);
-            } catch (Throwable t) {
-                LOG.warn("Could not inspect class {}", bd.getBeanClassName(), t);
-            }
+
+        ClassPathScanImplementationLookup lookup = (ClassPathScanImplementationLookup) getServletContext().
+                getAttribute(ConsoleInitializer.CLASSPATH_LOOKUP);
+        for (Class<? extends BasePage> clazz : lookup.getPageClasses()) {
+            MetaDataRoleAuthorizationStrategy.authorize(clazz, SyncopeConsoleSession.AUTHENTICATED);
         }
 
         getMarkupSettings().setStripWicketTags(true);
@@ -108,8 +159,8 @@ public class SyncopeConsoleApplication extends AuthenticatedWebApplication {
 
         mountPage("/login", getSignInPageClass());
 
-        final String activitiModelerDirectory = WebApplicationContextUtils.getWebApplicationContext(
-                WebApplication.get().getServletContext()).getBean("activitiModelerDirectory", String.class);
+        activitiModelerDirectory = props.getProperty("activitiModelerDirectory");
+        Assert.notNull(activitiModelerDirectory, "<activitiModelerDirectory> not set");
         mountResource("/" + ACTIVITI_MODELER_CONTEXT, new ResourceReference(ACTIVITI_MODELER_CONTEXT) {
 
             private static final long serialVersionUID = -128426276529456602L;
@@ -157,4 +208,36 @@ public class SyncopeConsoleApplication extends AuthenticatedWebApplication {
                         ? MustChangePassword.class
                         : Dashboard.class;
     }
+
+    public String getVersion() {
+        return version;
+    }
+
+    public String getSite() {
+        return site;
+    }
+
+    public String getLicense() {
+        return license;
+    }
+
+    public String getAnonymousUser() {
+        return anonymousUser;
+    }
+
+    public String getAnonymousKey() {
+        return anonymousKey;
+    }
+
+    public String getActivitiModelerDirectory() {
+        return activitiModelerDirectory;
+    }
+
+    public SyncopeClientFactoryBean getClientFactory() {
+        return clientFactory;
+    }
+
+    public MediaType getMediaType() {
+        return clientFactory.getContentType().getMediaType();
+    }
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/13f96e06/client/console/src/main/java/org/apache/syncope/client/console/SyncopeConsoleSession.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/SyncopeConsoleSession.java b/client/console/src/main/java/org/apache/syncope/client/console/SyncopeConsoleSession.java
index f48611f..667b525 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/SyncopeConsoleSession.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/SyncopeConsoleSession.java
@@ -44,12 +44,9 @@ import org.apache.syncope.common.rest.api.service.SyncopeService;
 import org.apache.wicket.Session;
 import org.apache.wicket.authroles.authentication.AuthenticatedWebSession;
 import org.apache.wicket.authroles.authorization.strategies.role.Roles;
-import org.apache.wicket.protocol.http.WebApplication;
 import org.apache.wicket.request.Request;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.springframework.context.ApplicationContext;
-import org.springframework.web.context.support.WebApplicationContextUtils;
 
 public class SyncopeConsoleSession extends AuthenticatedWebSession {
 
@@ -59,16 +56,12 @@ public class SyncopeConsoleSession extends AuthenticatedWebSession {
 
     private static final Logger LOG = LoggerFactory.getLogger(SyncopeConsoleSession.class);
 
-    private final String version;
-
     private final SyncopeTO syncopeTO;
 
     private final List<String> domains;
 
     private String domain;
 
-    private final SyncopeClientFactoryBean clientFactory;
-
     private final Map<Class<?>, Object> services = Collections.synchronizedMap(new HashMap<Class<?>, Object>());
 
     private SyncopeClient client;
@@ -90,17 +83,10 @@ public class SyncopeConsoleSession extends AuthenticatedWebSession {
     public SyncopeConsoleSession(final Request request) {
         super(request);
 
-        ApplicationContext ctx = WebApplicationContextUtils.
-                getWebApplicationContext(WebApplication.get().getServletContext());
-
-        clientFactory = ctx.getBean(SyncopeClientFactoryBean.class).
-                setContentType(SyncopeClientFactoryBean.ContentType.JSON);
-        String anonymousUser = ctx.getBean("anonymousUser", String.class);
-        String anonymousKey = ctx.getBean("anonymousKey", String.class);
+        SyncopeClient anonymousClient = SyncopeConsoleApplication.get().getClientFactory().create(
+                SyncopeConsoleApplication.get().getAnonymousUser(),
+                SyncopeConsoleApplication.get().getAnonymousKey());
 
-        version = ctx.getBean("version", String.class);
-
-        SyncopeClient anonymousClient = clientFactory.create(anonymousUser, anonymousKey);
         syncopeTO = anonymousClient.getService(SyncopeService.class).info();
         domains = new ArrayList<>();
         domains.add(SyncopeConstants.MASTER_DOMAIN);
@@ -114,10 +100,6 @@ public class SyncopeConsoleSession extends AuthenticatedWebSession {
                 }, domains);
     }
 
-    public String getVersion() {
-        return version;
-    }
-
     public SyncopeTO getSyncopeTO() {
         return syncopeTO;
     }
@@ -139,7 +121,8 @@ public class SyncopeConsoleSession extends AuthenticatedWebSession {
         boolean authenticated = false;
 
         try {
-            client = clientFactory.setDomain(getDomain()).create(username, password);
+            client = SyncopeConsoleApplication.get().getClientFactory().
+                    setDomain(getDomain()).create(username, password);
 
             Pair<Map<String, Set<String>>, UserTO> self = client.self();
             auth = self.getKey();
@@ -201,12 +184,15 @@ public class SyncopeConsoleSession extends AuthenticatedWebSession {
     public <T> T getService(final MediaType mediaType, final Class<T> serviceClass) {
         T service;
 
-        synchronized (clientFactory) {
-            SyncopeClientFactoryBean.ContentType preType = clientFactory.getContentType();
+        synchronized (SyncopeConsoleApplication.get().getClientFactory()) {
+            SyncopeClientFactoryBean.ContentType preType =
+                    SyncopeConsoleApplication.get().getClientFactory().getContentType();
 
-            clientFactory.setContentType(SyncopeClientFactoryBean.ContentType.fromString(mediaType.toString()));
-            service = clientFactory.create(username, password).getService(serviceClass);
-            clientFactory.setContentType(preType);
+            SyncopeConsoleApplication.get().getClientFactory().
+                    setContentType(SyncopeClientFactoryBean.ContentType.fromString(mediaType.toString()));
+            service = SyncopeConsoleApplication.get().getClientFactory().
+                    create(username, password).getService(serviceClass);
+            SyncopeConsoleApplication.get().getClientFactory().setContentType(preType);
         }
 
         return service;
@@ -218,12 +204,7 @@ public class SyncopeConsoleSession extends AuthenticatedWebSession {
     }
 
     public DateFormat getDateFormat() {
-        final Locale locale = getLocale() == null ? Locale.ENGLISH : getLocale();
-
+        Locale locale = getLocale() == null ? Locale.ENGLISH : getLocale();
         return DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT, locale);
     }
-
-    public MediaType getMediaType() {
-        return clientFactory.getContentType().getMediaType();
-    }
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/13f96e06/client/console/src/main/java/org/apache/syncope/client/console/commons/PreviewUtils.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/commons/PreviewUtils.java b/client/console/src/main/java/org/apache/syncope/client/console/commons/PreviewUtils.java
index 12c93d4..e88fcb3 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/commons/PreviewUtils.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/commons/PreviewUtils.java
@@ -18,31 +18,49 @@
  */
 package org.apache.syncope.client.console.commons;
 
+import java.lang.reflect.Constructor;
 import java.lang.reflect.InvocationTargetException;
 import org.apache.commons.lang3.StringUtils;
-import org.apache.syncope.client.console.init.ImplementationClassNamesLoader;
+import org.apache.syncope.client.console.SyncopeConsoleApplication;
+import org.apache.syncope.client.console.init.ClassPathScanImplementationLookup;
+import org.apache.syncope.client.console.init.ConsoleInitializer;
 import org.apache.syncope.client.console.wicket.markup.html.form.preview.AbstractBinaryPreviewer;
 import org.apache.wicket.Component;
 import org.apache.wicket.util.crypt.Base64;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.util.ClassUtils;
+import org.springframework.util.Assert;
 
-@org.springframework.stereotype.Component
-public class PreviewUtils {
+public final class PreviewUtils {
 
-    @Autowired
-    private ImplementationClassNamesLoader implementationClassNamesLoader;
+    public static PreviewUtils getInstance() {
+        return new PreviewUtils();
+    }
+
+    private static <T> Constructor<T> getConstructorIfAvailable(final Class<T> clazz, final Class<?>... paramTypes) {
+        Assert.notNull(clazz, "Class must not be null");
+        try {
+            return clazz.getConstructor(paramTypes);
+        } catch (NoSuchMethodException ex) {
+            return null;
+        }
+    }
+
+    private final ClassPathScanImplementationLookup classPathScanImplementationLookup;
+
+    private PreviewUtils() {
+        classPathScanImplementationLookup = (ClassPathScanImplementationLookup) SyncopeConsoleApplication.get().
+                getServletContext().getAttribute(ConsoleInitializer.CLASSPATH_LOOKUP);
+    }
 
     public Component getPreviewer(final String mimeType, final String file)
             throws InstantiationException, IllegalAccessException, InvocationTargetException {
 
-        final Class<? extends AbstractBinaryPreviewer> previewer = StringUtils.isBlank(file)
+        Class<? extends AbstractBinaryPreviewer> previewer = StringUtils.isBlank(file)
                 ? null
-                : implementationClassNamesLoader.getPreviewerClass(mimeType);
+                : classPathScanImplementationLookup.getPreviewerClass(mimeType);
 
         return previewer == null
                 ? null
-                : ClassUtils.getConstructorIfAvailable(previewer, String.class, String.class, byte[].class).
+                : getConstructorIfAvailable(previewer, String.class, String.class, byte[].class).
                 newInstance(new Object[] { "previewer", mimeType, Base64.decodeBase64(file) }).
                 preview();
     }
@@ -50,12 +68,12 @@ public class PreviewUtils {
     public Component getPreviewer(final String mimeType, final byte[] file)
             throws InstantiationException, IllegalAccessException, InvocationTargetException {
 
-        final Class<? extends AbstractBinaryPreviewer> previewer =
-                implementationClassNamesLoader.getPreviewerClass(mimeType);
+        Class<? extends AbstractBinaryPreviewer> previewer = classPathScanImplementationLookup.getPreviewerClass(
+                mimeType);
 
         return previewer == null
                 ? null
-                : ClassUtils.getConstructorIfAvailable(previewer, String.class, String.class, byte[].class).
+                : getConstructorIfAvailable(previewer, String.class, String.class, byte[].class).
                 newInstance(new Object[] { "previewer", mimeType, file }).
                 preview();
     }

http://git-wip-us.apache.org/repos/asf/syncope/blob/13f96e06/client/console/src/main/java/org/apache/syncope/client/console/init/ClassPathScanImplementationLookup.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/init/ClassPathScanImplementationLookup.java b/client/console/src/main/java/org/apache/syncope/client/console/init/ClassPathScanImplementationLookup.java
new file mode 100644
index 0000000..3c28c04
--- /dev/null
+++ b/client/console/src/main/java/org/apache/syncope/client/console/init/ClassPathScanImplementationLookup.java
@@ -0,0 +1,109 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.client.console.init;
+
+import java.lang.reflect.Modifier;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import org.apache.commons.lang3.ArrayUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.syncope.client.console.panels.AbstractExtensionPanel;
+import org.apache.syncope.client.console.annotations.BinaryPreview;
+import org.apache.syncope.client.console.pages.BasePage;
+import org.apache.syncope.client.console.wicket.markup.html.form.preview.AbstractBinaryPreviewer;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.config.BeanDefinition;
+import org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider;
+import org.springframework.core.type.filter.AssignableTypeFilter;
+import org.springframework.util.ClassUtils;
+
+public class ClassPathScanImplementationLookup {
+
+    private static final Logger LOG = LoggerFactory.getLogger(ClassPathScanImplementationLookup.class);
+
+    private List<Class<? extends BasePage>> pages;
+
+    private List<Class<? extends AbstractBinaryPreviewer>> previewers;
+
+    private List<Class<? extends AbstractExtensionPanel>> extPanels;
+
+    @SuppressWarnings("unchecked")
+    public void load() {
+        pages = new ArrayList<>();
+        previewers = new ArrayList<>();
+        extPanels = new ArrayList<>();
+
+        ClassPathScanningCandidateComponentProvider scanner = new ClassPathScanningCandidateComponentProvider(false);
+        scanner.addIncludeFilter(new AssignableTypeFilter(BasePage.class));
+        scanner.addIncludeFilter(new AssignableTypeFilter(AbstractBinaryPreviewer.class));
+        scanner.addIncludeFilter(new AssignableTypeFilter(AbstractExtensionPanel.class));
+
+        for (BeanDefinition bd : scanner.findCandidateComponents(StringUtils.EMPTY)) {
+            try {
+                Class<?> clazz = ClassUtils.resolveClassName(
+                        bd.getBeanClassName(), ClassUtils.getDefaultClassLoader());
+                boolean isAbsractClazz = Modifier.isAbstract(clazz.getModifiers());
+
+                if (BasePage.class.isAssignableFrom(clazz) && !isAbsractClazz) {
+                    pages.add((Class<? extends BasePage>) clazz);
+                } else if (AbstractBinaryPreviewer.class.isAssignableFrom(clazz) && !isAbsractClazz) {
+                    previewers.add((Class<? extends AbstractBinaryPreviewer>) clazz);
+                } else if (AbstractExtensionPanel.class.isAssignableFrom(clazz) && !isAbsractClazz) {
+                    extPanels.add((Class<? extends AbstractExtensionPanel>) clazz);
+                }
+            } catch (Throwable t) {
+                LOG.warn("Could not inspect class {}", bd.getBeanClassName(), t);
+            }
+        }
+        pages = Collections.unmodifiableList(pages);
+        previewers = Collections.unmodifiableList(previewers);
+        extPanels = Collections.unmodifiableList(extPanels);
+
+        LOG.debug("Binary previewers found: {}", previewers);
+        LOG.debug("Extension panels found: {}", extPanels);
+    }
+
+    public Class<? extends AbstractBinaryPreviewer> getPreviewerClass(final String mimeType) {
+        LOG.debug("Searching for previewer class for MIME type: {}", mimeType);
+        Class<? extends AbstractBinaryPreviewer> previewer = null;
+        for (Class<? extends AbstractBinaryPreviewer> candidate : previewers) {
+            LOG.debug("Evaluating previewer class {} for MIME type {}", candidate.getName(), mimeType);
+            if (ArrayUtils.contains(candidate.getAnnotation(BinaryPreview.class).mimeTypes(), mimeType)) {
+                LOG.debug("Found existing previewer for MIME type {}: {}", mimeType, candidate.getName());
+                previewer = candidate;
+            }
+        }
+        return previewer;
+    }
+
+    public List<Class<? extends BasePage>> getPageClasses() {
+        return pages;
+    }
+
+    public List<Class<? extends AbstractBinaryPreviewer>> getPreviewerClasses() {
+        return previewers;
+    }
+
+    public List<Class<? extends AbstractExtensionPanel>> getExtPanelClasses() {
+        return extPanels;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/13f96e06/client/console/src/main/java/org/apache/syncope/client/console/init/ConsoleInitializer.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/init/ConsoleInitializer.java b/client/console/src/main/java/org/apache/syncope/client/console/init/ConsoleInitializer.java
index 87fa6ad..6f42002 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/init/ConsoleInitializer.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/init/ConsoleInitializer.java
@@ -18,54 +18,40 @@
  */
 package org.apache.syncope.client.console.init;
 
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.List;
-import java.util.Map;
+import javax.servlet.ServletContextEvent;
+import javax.servlet.ServletContextListener;
+import javax.servlet.annotation.WebListener;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.springframework.aop.support.AopUtils;
-import org.springframework.beans.factory.BeanFactory;
-import org.springframework.beans.factory.BeanFactoryAware;
-import org.springframework.beans.factory.InitializingBean;
-import org.springframework.beans.factory.support.DefaultListableBeanFactory;
-import org.springframework.stereotype.Component;
 
 /**
  * Take care of all initializations needed by Syncope Console to run up and safe.
  */
-@Component
-public class ConsoleInitializer implements InitializingBean, BeanFactoryAware {
+@WebListener
+public class ConsoleInitializer implements ServletContextListener {
 
     private static final Logger LOG = LoggerFactory.getLogger(ConsoleInitializer.class);
 
-    private DefaultListableBeanFactory beanFactory;
+    public static final String CLASSPATH_LOOKUP = "CLASSPATH_LOOKUP";
 
-    @Override
-    public void setBeanFactory(final BeanFactory beanFactory) {
-        this.beanFactory = (DefaultListableBeanFactory) beanFactory;
-    }
+    public static final String MIMETYPES_LOADER = "MIMETYPES_LOADER";
 
     @Override
-    public void afterPropertiesSet() {
-        Map<String, SyncopeConsoleLoader> loaderMap = beanFactory.getBeansOfType(SyncopeConsoleLoader.class);
-
-        List<SyncopeConsoleLoader> loaders = new ArrayList<>(loaderMap.values());
-        Collections.sort(loaders, new Comparator<SyncopeConsoleLoader>() {
+    public void contextInitialized(final ServletContextEvent sce) {
+        ClassPathScanImplementationLookup lookup = new ClassPathScanImplementationLookup();
+        lookup.load();
+        sce.getServletContext().setAttribute(CLASSPATH_LOOKUP, lookup);
 
-            @Override
-            public int compare(final SyncopeConsoleLoader o1, final SyncopeConsoleLoader o2) {
-                return o1.getPriority().compareTo(o2.getPriority());
-            }
-        });
+        MIMETypesLoader mimeTypes = new MIMETypesLoader();
+        mimeTypes.load();
+        sce.getServletContext().setAttribute(MIMETYPES_LOADER, mimeTypes);
 
-        LOG.debug("Starting initialization...");
-        for (SyncopeConsoleLoader loader : loaders) {
-            LOG.debug("Invoking {} with priority {}", AopUtils.getTargetClass(loader).getName(), loader.getPriority());
-            loader.load();
-        }
         LOG.debug("Initialization completed");
     }
 
+    @Override
+    public void contextDestroyed(final ServletContextEvent sce) {
+        // nothing to do
+    }
+
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/13f96e06/client/console/src/main/java/org/apache/syncope/client/console/init/ImplementationClassNamesLoader.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/init/ImplementationClassNamesLoader.java b/client/console/src/main/java/org/apache/syncope/client/console/init/ImplementationClassNamesLoader.java
deleted file mode 100644
index 00a9027..0000000
--- a/client/console/src/main/java/org/apache/syncope/client/console/init/ImplementationClassNamesLoader.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.syncope.client.console.init;
-
-import java.lang.reflect.Modifier;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import org.apache.commons.lang3.ArrayUtils;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.syncope.client.console.panels.AbstractExtensionPanel;
-import org.apache.syncope.client.console.annotations.BinaryPreview;
-import org.apache.syncope.client.console.wicket.markup.html.form.preview.AbstractBinaryPreviewer;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.config.BeanDefinition;
-import org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider;
-import org.springframework.core.type.filter.AssignableTypeFilter;
-import org.springframework.stereotype.Component;
-import org.springframework.util.ClassUtils;
-
-@Component
-public class ImplementationClassNamesLoader implements SyncopeConsoleLoader {
-
-    private static final Logger LOG = LoggerFactory.getLogger(ImplementationClassNamesLoader.class);
-
-    private List<Class<? extends AbstractBinaryPreviewer>> previewers;
-
-    private List<Class<? extends AbstractExtensionPanel>> extPanels;
-
-    @Override
-    public Integer getPriority() {
-        return 0;
-    }
-
-    @Override
-    @SuppressWarnings("unchecked")
-    public void load() {
-        previewers = new ArrayList<>();
-        extPanels = new ArrayList<>();
-
-        ClassPathScanningCandidateComponentProvider scanner = new ClassPathScanningCandidateComponentProvider(false);
-        scanner.addIncludeFilter(new AssignableTypeFilter(AbstractBinaryPreviewer.class));
-        scanner.addIncludeFilter(new AssignableTypeFilter(AbstractExtensionPanel.class));
-
-        for (BeanDefinition bd : scanner.findCandidateComponents(StringUtils.EMPTY)) {
-            try {
-                Class<?> clazz = ClassUtils.resolveClassName(
-                        bd.getBeanClassName(), ClassUtils.getDefaultClassLoader());
-                boolean isAbsractClazz = Modifier.isAbstract(clazz.getModifiers());
-
-                if (AbstractBinaryPreviewer.class.isAssignableFrom(clazz) && !isAbsractClazz) {
-                    previewers.add((Class<? extends AbstractBinaryPreviewer>) clazz);
-                } else if (AbstractExtensionPanel.class.isAssignableFrom(clazz) && !isAbsractClazz) {
-                    extPanels.add((Class<? extends AbstractExtensionPanel>) clazz);
-                }
-            } catch (Throwable t) {
-                LOG.warn("Could not inspect class {}", bd.getBeanClassName(), t);
-            }
-        }
-        previewers = Collections.unmodifiableList(previewers);
-        extPanels = Collections.unmodifiableList(extPanels);
-
-        LOG.debug("Binary previewers found: {}", previewers);
-        LOG.debug("Extension panels found: {}", extPanels);
-    }
-
-    public Class<? extends AbstractBinaryPreviewer> getPreviewerClass(final String mimeType) {
-        LOG.debug("Searching for previewer class for MIME type: {}", mimeType);
-        Class<? extends AbstractBinaryPreviewer> previewer = null;
-        for (Class<? extends AbstractBinaryPreviewer> candidate : previewers) {
-            LOG.debug("Evaluating previewer class {} for MIME type {}", candidate.getName(), mimeType);
-            if (ArrayUtils.contains(candidate.getAnnotation(BinaryPreview.class).mimeTypes(), mimeType)) {
-                LOG.debug("Found existing previewer for MIME type {}: {}", mimeType, candidate.getName());
-                previewer = candidate;
-            }
-        }
-        return previewer;
-    }
-
-    public List<Class<? extends AbstractBinaryPreviewer>> getPreviewerClasses() {
-        return previewers;
-    }
-
-    public List<Class<? extends AbstractExtensionPanel>> getExtPanelClasses() {
-        return extPanels;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/syncope/blob/13f96e06/client/console/src/main/java/org/apache/syncope/client/console/init/MIMETypesLoader.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/init/MIMETypesLoader.java b/client/console/src/main/java/org/apache/syncope/client/console/init/MIMETypesLoader.java
index 7a2f878..62dcff3 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/init/MIMETypesLoader.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/init/MIMETypesLoader.java
@@ -27,26 +27,15 @@ import org.apache.commons.lang3.StringUtils;
 import org.apache.wicket.util.io.IOUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.springframework.stereotype.Component;
 
-@Component
-public class MIMETypesLoader implements SyncopeConsoleLoader {
+public class MIMETypesLoader {
 
-    /**
-     * Logger.
-     */
     private static final Logger LOG = LoggerFactory.getLogger(MIMETypesLoader.class);
 
     private List<String> mimeTypes;
 
-    @Override
-    public Integer getPriority() {
-        return 10;
-    }
-
-    @Override
     public void load() {
-        final Set<String> mediaTypes = new HashSet<>();
+        Set<String> mediaTypes = new HashSet<>();
         this.mimeTypes = new ArrayList<>();
         try {
             final String mimeTypesFile = IOUtils.toString(getClass().getResourceAsStream("/MIMETypes"));

http://git-wip-us.apache.org/repos/asf/syncope/blob/13f96e06/client/console/src/main/java/org/apache/syncope/client/console/init/SyncopeConsoleLoader.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/init/SyncopeConsoleLoader.java b/client/console/src/main/java/org/apache/syncope/client/console/init/SyncopeConsoleLoader.java
deleted file mode 100644
index 7c4d3d4..0000000
--- a/client/console/src/main/java/org/apache/syncope/client/console/init/SyncopeConsoleLoader.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.syncope.client.console.init;
-
-/**
- * Marker interface for Syncope console initialization.
- */
-public interface SyncopeConsoleLoader {
-
-    /**
-     * @return the priority that the implementing class has in the initialization process.
-     */
-    Integer getPriority();
-
-    /**
-     * Perform initialization operations.
-     */
-    void load();
-}

http://git-wip-us.apache.org/repos/asf/syncope/blob/13f96e06/client/console/src/main/java/org/apache/syncope/client/console/pages/AbstractBasePage.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/pages/AbstractBasePage.java b/client/console/src/main/java/org/apache/syncope/client/console/pages/AbstractBasePage.java
index bd88711..c4096af 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/pages/AbstractBasePage.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/pages/AbstractBasePage.java
@@ -19,24 +19,13 @@
 package org.apache.syncope.client.console.pages;
 
 import org.apache.syncope.client.console.commons.Constants;
-import org.apache.syncope.client.console.init.MIMETypesLoader;
 import org.apache.syncope.client.console.panels.NotificationPanel;
-import org.apache.syncope.client.console.rest.ConfigurationRestClient;
-import org.apache.syncope.client.console.rest.ConnectorRestClient;
-import org.apache.syncope.client.console.rest.ReportRestClient;
-import org.apache.syncope.client.console.rest.ResourceRestClient;
-import org.apache.syncope.client.console.rest.GroupRestClient;
-import org.apache.syncope.client.console.rest.SchemaRestClient;
-import org.apache.syncope.client.console.rest.TaskRestClient;
-import org.apache.syncope.client.console.rest.UserRestClient;
-import org.apache.syncope.client.console.rest.UserSelfRestClient;
 import org.apache.syncope.client.console.wicket.markup.head.MetaHeaderItem;
 import org.apache.wicket.markup.head.HeaderItem;
 import org.apache.wicket.markup.head.IHeaderResponse;
 import org.apache.wicket.markup.head.PriorityHeaderItem;
 import org.apache.wicket.markup.html.WebPage;
 import org.apache.wicket.request.mapper.parameter.PageParameters;
-import org.apache.wicket.spring.injection.annot.SpringBean;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -56,36 +45,6 @@ public class AbstractBasePage extends WebPage {
 
     protected final HeaderItem meta = new MetaHeaderItem("X-UA-Compatible", "IE=edge");
 
-    @SpringBean
-    protected UserRestClient userRestClient;
-
-    @SpringBean
-    protected UserSelfRestClient userSelfRestClient;
-
-    @SpringBean
-    protected GroupRestClient groupRestClient;
-
-    @SpringBean
-    protected TaskRestClient taskRestClient;
-
-    @SpringBean
-    protected SchemaRestClient schemaRestClient;
-
-    @SpringBean
-    protected ResourceRestClient resourceRestClient;
-
-    @SpringBean
-    protected ConnectorRestClient connectorRestClient;
-
-    @SpringBean
-    protected ReportRestClient reportRestClient;
-
-    @SpringBean
-    protected ConfigurationRestClient confRestClient;
-
-    @SpringBean
-    protected MIMETypesLoader mimeTypesInitializer;
-
     protected NotificationPanel feedbackPanel;
 
     /**

http://git-wip-us.apache.org/repos/asf/syncope/blob/13f96e06/client/console/src/main/java/org/apache/syncope/client/console/pages/BasePage.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/pages/BasePage.java b/client/console/src/main/java/org/apache/syncope/client/console/pages/BasePage.java
index bcbd3bf..1ea44d5 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/pages/BasePage.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/pages/BasePage.java
@@ -18,6 +18,7 @@
  */
 package org.apache.syncope.client.console.pages;
 
+import org.apache.syncope.client.console.SyncopeConsoleApplication;
 import org.apache.syncope.client.console.SyncopeConsoleSession;
 import org.apache.syncope.client.console.commons.Constants;
 import org.apache.syncope.client.console.rest.UserWorkflowRestClient;
@@ -37,14 +38,12 @@ import org.apache.wicket.markup.html.WebPage;
 import org.apache.wicket.markup.html.basic.Label;
 import org.apache.wicket.markup.html.link.BookmarkablePageLink;
 import org.apache.wicket.request.mapper.parameter.PageParameters;
-import org.apache.wicket.spring.injection.annot.SpringBean;
 
 public class BasePage extends AbstractBasePage implements IAjaxIndicatorAware {
 
     private static final long serialVersionUID = 1571997737305598502L;
 
-    @SpringBean
-    private UserWorkflowRestClient userWorkflowRestClient;
+    private final UserWorkflowRestClient userWorkflowRestClient = new UserWorkflowRestClient();
 
     public BasePage() {
         this(null);
@@ -62,7 +61,7 @@ public class BasePage extends AbstractBasePage implements IAjaxIndicatorAware {
         super(parameters);
 
         // header, footer
-        add(new Label("version", SyncopeConsoleSession.get().getVersion()));
+        add(new Label("version", SyncopeConsoleApplication.get().getVersion()));
         add(new Label("username", SyncopeConsoleSession.get().getSelfTO().getUsername()));
 
         final WebMarkupContainer todosContainer = new WebMarkupContainer("todosContainer");

http://git-wip-us.apache.org/repos/asf/syncope/blob/13f96e06/client/console/src/main/java/org/apache/syncope/client/console/pages/DisplayAttributesModalPage.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/pages/DisplayAttributesModalPage.java b/client/console/src/main/java/org/apache/syncope/client/console/pages/DisplayAttributesModalPage.java
index 432c510..7be2525 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/pages/DisplayAttributesModalPage.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/pages/DisplayAttributesModalPage.java
@@ -42,7 +42,6 @@ import org.apache.wicket.model.IModel;
 import org.apache.wicket.model.LoadableDetachableModel;
 import org.apache.wicket.model.PropertyModel;
 import org.apache.wicket.model.ResourceModel;
-import org.apache.wicket.spring.injection.annot.SpringBean;
 
 /**
  * Modal window with Display attributes form.
@@ -59,8 +58,7 @@ public abstract class DisplayAttributesModalPage<T extends AnyTO> extends Abstra
      */
     private static final int MAX_SELECTIONS = 9;
 
-    @SpringBean
-    private PreferenceManager prefMan;
+    private final PreferenceManager prefMan = new PreferenceManager();
 
     private final List<String> selectedDetails;
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/13f96e06/client/console/src/main/java/org/apache/syncope/client/console/pages/Login.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/pages/Login.java b/client/console/src/main/java/org/apache/syncope/client/console/pages/Login.java
index 7e56e92..754dacd 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/pages/Login.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/pages/Login.java
@@ -40,15 +40,11 @@ import org.apache.wicket.markup.html.form.TextField;
 import org.apache.wicket.model.IModel;
 import org.apache.wicket.model.Model;
 import org.apache.wicket.request.mapper.parameter.PageParameters;
-import org.apache.wicket.spring.injection.annot.SpringBean;
 
 public class Login extends WebPage {
 
     private static final long serialVersionUID = 5889157642852559004L;
 
-    @SpringBean(name = "anonymousUser")
-    private String anonymousUser;
-
     private final NotificationPanel feedbackPanel;
 
     private final StatelessForm<Void> form;
@@ -93,7 +89,7 @@ public class Login extends WebPage {
 
             @Override
             protected void onSubmit(final AjaxRequestTarget target, final Form<?> form) {
-                if (anonymousUser.equals(usernameField.getRawInput())) {
+                if (SyncopeConsoleApplication.get().getAnonymousUser().equals(usernameField.getRawInput())) {
                     throw new AccessControlException("Illegal username");
                 }
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/13f96e06/client/console/src/main/java/org/apache/syncope/client/console/pages/MustChangePassword.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/pages/MustChangePassword.java b/client/console/src/main/java/org/apache/syncope/client/console/pages/MustChangePassword.java
index 5396561..51a3f6e 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/pages/MustChangePassword.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/pages/MustChangePassword.java
@@ -33,7 +33,6 @@ import org.apache.wicket.markup.html.form.TextField;
 import org.apache.wicket.markup.html.form.validation.EqualPasswordInputValidator;
 import org.apache.wicket.model.Model;
 import org.apache.wicket.request.mapper.parameter.PageParameters;
-import org.apache.wicket.spring.injection.annot.SpringBean;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -43,8 +42,7 @@ public class MustChangePassword extends WebPage {
 
     private static final Logger LOG = LoggerFactory.getLogger(MustChangePassword.class);
 
-    @SpringBean
-    private UserSelfRestClient userSelfRestClient;
+    private final UserSelfRestClient userSelfRestClient = new UserSelfRestClient();
 
     private final NotificationPanel feedbackPanel;
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/13f96e06/client/console/src/main/java/org/apache/syncope/client/console/pages/ProvisioningModalPage.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/pages/ProvisioningModalPage.java b/client/console/src/main/java/org/apache/syncope/client/console/pages/ProvisioningModalPage.java
index 95ec54f..847bd61 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/pages/ProvisioningModalPage.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/pages/ProvisioningModalPage.java
@@ -30,6 +30,9 @@ import org.apache.syncope.client.console.commons.status.ConnObjectWrapper;
 import org.apache.syncope.client.console.commons.status.StatusBean;
 import org.apache.syncope.client.console.commons.status.StatusUtils;
 import org.apache.syncope.client.console.panels.ActionDataTablePanel;
+import org.apache.syncope.client.console.rest.GroupRestClient;
+import org.apache.syncope.client.console.rest.ResourceRestClient;
+import org.apache.syncope.client.console.rest.UserRestClient;
 import org.apache.syncope.client.console.wicket.markup.html.bootstrap.dialog.BaseModal;
 import org.apache.syncope.client.console.wicket.markup.html.form.ActionLink;
 import org.apache.syncope.client.lib.SyncopeClient;
@@ -59,6 +62,12 @@ public class ProvisioningModalPage<T extends AnyTO> extends AbstractStatusModalP
 
     private static final int ROWS_PER_PAGE = 10;
 
+    private final UserRestClient userRestClient = new UserRestClient();
+
+    private final GroupRestClient groupRestClient = new GroupRestClient();
+
+    private final ResourceRestClient resourceRestClient = new ResourceRestClient();
+
     private final ResourceTO resourceTO;
 
     private final AnyTypeKind anyTypeKind;

http://git-wip-us.apache.org/repos/asf/syncope/blob/13f96e06/client/console/src/main/java/org/apache/syncope/client/console/pages/Realms.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/pages/Realms.java b/client/console/src/main/java/org/apache/syncope/client/console/pages/Realms.java
index 300db13..0767b33 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/pages/Realms.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/pages/Realms.java
@@ -42,14 +42,12 @@ import org.apache.wicket.markup.html.basic.Label;
 import org.apache.wicket.model.Model;
 import org.apache.wicket.model.ResourceModel;
 import org.apache.wicket.request.mapper.parameter.PageParameters;
-import org.apache.wicket.spring.injection.annot.SpringBean;
 
 public class Realms extends BasePage {
 
     private static final long serialVersionUID = -1100228004207271270L;
 
-    @SpringBean
-    private RealmRestClient realmRestClient;
+    private final RealmRestClient realmRestClient = new RealmRestClient();
 
     private final RealmSidebarPanel realmSidebarPanel;
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/13f96e06/client/console/src/main/java/org/apache/syncope/client/console/pages/ResultStatusModal.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/pages/ResultStatusModal.java b/client/console/src/main/java/org/apache/syncope/client/console/pages/ResultStatusModal.java
index 855a61f..998ac60 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/pages/ResultStatusModal.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/pages/ResultStatusModal.java
@@ -36,6 +36,7 @@ import org.apache.syncope.client.console.commons.status.Status;
 import org.apache.syncope.client.console.commons.status.StatusUtils;
 import org.apache.syncope.client.console.panels.AbstractModalPanel;
 import org.apache.syncope.client.console.panels.FailureMessageModal;
+import org.apache.syncope.client.console.rest.UserRestClient;
 import org.apache.syncope.client.console.wicket.markup.html.bootstrap.dialog.BaseModal;
 import org.apache.syncope.common.lib.to.AnyTO;
 import org.apache.syncope.common.lib.to.AttrTO;
@@ -107,7 +108,7 @@ public final class ResultStatusModal<T extends AnyTO> extends AbstractModalPanel
         }
 
         public ResultStatusModal<T> build() {
-            return new ResultStatusModal<T>(modal, pageRef, this);
+            return new ResultStatusModal<>(modal, pageRef, this);
         }
     }
 
@@ -115,10 +116,11 @@ public final class ResultStatusModal<T extends AnyTO> extends AbstractModalPanel
             final BaseModal<T> modal,
             final PageReference pageRef,
             final Builder<T> builder) {
+
         super(modal, pageRef);
 
         this.subject = builder.subject;
-        statusUtils = new StatusUtils(this.userRestClient);
+        statusUtils = new StatusUtils(new UserRestClient());
         if (builder.mode == null) {
             this.mode = Mode.ADMIN;
         } else {

http://git-wip-us.apache.org/repos/asf/syncope/blob/13f96e06/client/console/src/main/java/org/apache/syncope/client/console/pages/StatusModalPage.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/pages/StatusModalPage.java b/client/console/src/main/java/org/apache/syncope/client/console/pages/StatusModalPage.java
index f70c1c5..7dbe73e 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/pages/StatusModalPage.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/pages/StatusModalPage.java
@@ -31,6 +31,9 @@ import org.apache.syncope.client.console.commons.status.Status;
 import org.apache.syncope.client.console.commons.status.StatusBean;
 import org.apache.syncope.client.console.commons.status.StatusUtils;
 import org.apache.syncope.client.console.panels.ActionDataTablePanel;
+import org.apache.syncope.client.console.rest.GroupRestClient;
+import org.apache.syncope.client.console.rest.ResourceRestClient;
+import org.apache.syncope.client.console.rest.UserRestClient;
 import org.apache.syncope.client.console.wicket.ajax.markup.html.ClearIndicatingAjaxButton;
 import org.apache.syncope.client.console.wicket.markup.html.bootstrap.dialog.BaseModal;
 import org.apache.syncope.client.console.wicket.markup.html.form.ActionLink;
@@ -65,6 +68,12 @@ public class StatusModalPage<T extends AnyTO> extends AbstractStatusModalPage {
 
     private static final long serialVersionUID = -9148734710505211261L;
 
+    private final UserRestClient userRestClient = new UserRestClient();
+
+    private final GroupRestClient groupRestClient = new GroupRestClient();
+
+    private final ResourceRestClient resourceRestClient = new ResourceRestClient();
+
     private final AnyTO anyTO;
 
     private int rowsPerPage = 10;
@@ -207,7 +216,7 @@ public class StatusModalPage<T extends AnyTO> extends AbstractStatusModalPage {
         confirm = new PasswordTextField("confirm", new Model<String>());
         pwdMgtForm.add(confirm.setRequired(false).setEnabled(false));
 
-        changepwd = new AjaxCheckBoxPanel("changepwd", "changepwd", new Model<Boolean>(false));
+        changepwd = new AjaxCheckBoxPanel("changepwd", "changepwd", new Model<>(false));
         pwdMgtForm.add(changepwd.setModelObject(false));
         pwdMgtForm.add(new Label("changePwdLabel", new ResourceModel("changePwdLabel", "Password propagation")));
 
@@ -494,7 +503,7 @@ public class StatusModalPage<T extends AnyTO> extends AbstractStatusModalPage {
 
             final List<ConnObjectWrapper> connObjects = statusUtils.getConnectorObjects(anyTO);
 
-            final List<StatusBean> statusBeans = new ArrayList<StatusBean>(connObjects.size() + 1);
+            final List<StatusBean> statusBeans = new ArrayList<>(connObjects.size() + 1);
 
             for (ConnObjectWrapper entry : connObjects) {
                 final StatusBean statusBean = statusUtils.getStatusBean(anyTO,
@@ -609,7 +618,7 @@ public class StatusModalPage<T extends AnyTO> extends AbstractStatusModalPage {
             final AjaxRequestTarget target,
             final Collection<StatusBean> selection,
             final BulkActionResult bulkActionResult) {
-        final List<String> resources = new ArrayList<String>(selection.size());
+        final List<String> resources = new ArrayList<>(selection.size());
         for (StatusBean statusBean : selection) {
             resources.add(statusBean.getResourceName());
         }
@@ -617,7 +626,7 @@ public class StatusModalPage<T extends AnyTO> extends AbstractStatusModalPage {
         final List<ConnObjectWrapper> connObjects = statusUtils.getConnectorObjects(Collections.singletonList(anyTO),
                 resources);
 
-        final List<StatusBean> statusBeans = new ArrayList<StatusBean>(connObjects.size());
+        final List<StatusBean> statusBeans = new ArrayList<>(connObjects.size());
 
         for (ConnObjectWrapper entry : connObjects) {
             final StatusBean statusBean = statusUtils.getStatusBean(anyTO,
@@ -628,7 +637,7 @@ public class StatusModalPage<T extends AnyTO> extends AbstractStatusModalPage {
             statusBeans.add(statusBean);
         }
 
-        target.add(modal.setContent(new BulkActionResultModalPage<StatusBean, String>(
+        target.add(modal.setContent(new BulkActionResultModalPage<>(
                 modal,
                 pageRef,
                 statusBeans,

http://git-wip-us.apache.org/repos/asf/syncope/blob/13f96e06/client/console/src/main/java/org/apache/syncope/client/console/pages/Workflow.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/pages/Workflow.java b/client/console/src/main/java/org/apache/syncope/client/console/pages/Workflow.java
index b16bd2a..3a0ef0b 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/pages/Workflow.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/pages/Workflow.java
@@ -19,6 +19,7 @@
 package org.apache.syncope.client.console.pages;
 
 import java.io.File;
+import org.apache.syncope.client.console.SyncopeConsoleApplication;
 import org.apache.syncope.client.console.rest.WorkflowRestClient;
 import org.apache.syncope.client.console.wicket.markup.html.link.VeilPopupSettings;
 import org.apache.syncope.common.lib.types.Entitlement;
@@ -27,19 +28,15 @@ import org.apache.wicket.markup.html.WebMarkupContainer;
 import org.apache.wicket.markup.html.image.Image;
 import org.apache.wicket.markup.html.link.BookmarkablePageLink;
 import org.apache.wicket.model.Model;
-import org.apache.wicket.protocol.http.WebApplication;
 import org.apache.wicket.request.mapper.parameter.PageParameters;
 import org.apache.wicket.request.resource.DynamicImageResource;
 import org.apache.wicket.request.resource.IResource;
-import org.apache.wicket.spring.injection.annot.SpringBean;
-import org.springframework.web.context.support.WebApplicationContextUtils;
 
 public class Workflow extends BasePage {
 
     private static final long serialVersionUID = -8781434495150074529L;
 
-    @SpringBean
-    private WorkflowRestClient wfRestClient;
+    private final WorkflowRestClient wfRestClient = new WorkflowRestClient();
 
     public Workflow(final PageParameters parameters) {
         super(parameters);
@@ -65,9 +62,7 @@ public class Workflow extends BasePage {
         // Check if Activiti Modeler directory is found
         boolean activitiModelerEnabled = false;
         try {
-            String activitiModelerDirectory = WebApplicationContextUtils.getWebApplicationContext(
-                    WebApplication.get().getServletContext()).getBean("activitiModelerDirectory", String.class);
-            File baseDir = new File(activitiModelerDirectory);
+            File baseDir = new File(SyncopeConsoleApplication.get().getActivitiModelerDirectory());
             activitiModelerEnabled = baseDir.exists() && baseDir.canRead() && baseDir.isDirectory();
         } catch (Exception e) {
             LOG.error("Could not check for Activiti Modeler directory", e);

http://git-wip-us.apache.org/repos/asf/syncope/blob/13f96e06/client/console/src/main/java/org/apache/syncope/client/console/pages/XMLEditorPopupPage.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/pages/XMLEditorPopupPage.java b/client/console/src/main/java/org/apache/syncope/client/console/pages/XMLEditorPopupPage.java
index c02d9ac..00d2c7f 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/pages/XMLEditorPopupPage.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/pages/XMLEditorPopupPage.java
@@ -33,15 +33,13 @@ import org.apache.wicket.markup.html.form.Button;
 import org.apache.wicket.markup.html.form.Form;
 import org.apache.wicket.markup.html.form.TextArea;
 import org.apache.wicket.model.Model;
-import org.apache.wicket.spring.injection.annot.SpringBean;
 import org.apache.wicket.util.io.IOUtils;
 
 public class XMLEditorPopupPage extends BasePopupPage {
 
     private static final long serialVersionUID = 5816041644635271734L;
 
-    @SpringBean
-    private WorkflowRestClient wfRestClient;
+    private final WorkflowRestClient wfRestClient = new WorkflowRestClient();
 
     public XMLEditorPopupPage() {
         Form<?> wfForm = new Form<>("workflowDefForm");

http://git-wip-us.apache.org/repos/asf/syncope/blob/13f96e06/client/console/src/main/java/org/apache/syncope/client/console/panels/AbstractModalPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/AbstractModalPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/AbstractModalPanel.java
index 96d538b..2c244b2 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/AbstractModalPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/AbstractModalPanel.java
@@ -18,16 +18,6 @@
  */
 package org.apache.syncope.client.console.panels;
 
-import org.apache.syncope.client.console.init.MIMETypesLoader;
-import org.apache.syncope.client.console.rest.ConfigurationRestClient;
-import org.apache.syncope.client.console.rest.ConnectorRestClient;
-import org.apache.syncope.client.console.rest.ReportRestClient;
-import org.apache.syncope.client.console.rest.ResourceRestClient;
-import org.apache.syncope.client.console.rest.GroupRestClient;
-import org.apache.syncope.client.console.rest.SchemaRestClient;
-import org.apache.syncope.client.console.rest.TaskRestClient;
-import org.apache.syncope.client.console.rest.UserRestClient;
-import org.apache.syncope.client.console.rest.UserSelfRestClient;
 import org.apache.syncope.client.console.wicket.markup.head.MetaHeaderItem;
 import org.apache.syncope.client.console.wicket.markup.html.bootstrap.dialog.BaseModal;
 import org.apache.wicket.PageReference;
@@ -37,7 +27,6 @@ import org.apache.wicket.markup.head.IHeaderResponse;
 import org.apache.wicket.markup.head.PriorityHeaderItem;
 import org.apache.wicket.markup.html.form.Form;
 import org.apache.wicket.markup.html.panel.Panel;
-import org.apache.wicket.spring.injection.annot.SpringBean;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -61,36 +50,6 @@ public class AbstractModalPanel extends Panel {
 
     protected final HeaderItem meta = new MetaHeaderItem("X-UA-Compatible", "IE=edge");
 
-    @SpringBean
-    protected UserRestClient userRestClient;
-
-    @SpringBean
-    protected UserSelfRestClient userSelfRestClient;
-
-    @SpringBean
-    protected GroupRestClient groupRestClient;
-
-    @SpringBean
-    protected TaskRestClient taskRestClient;
-
-    @SpringBean
-    protected SchemaRestClient schemaRestClient;
-
-    @SpringBean
-    protected ResourceRestClient resourceRestClient;
-
-    @SpringBean
-    protected ConnectorRestClient connectorRestClient;
-
-    @SpringBean
-    protected ReportRestClient reportRestClient;
-
-    @SpringBean
-    protected ConfigurationRestClient confRestClient;
-
-    @SpringBean
-    protected MIMETypesLoader mimeTypesInitializer;
-
     public AbstractModalPanel(final BaseModal<?> modal, final PageReference pageRef) {
         super(BaseModal.getContentId());
         this.pageRef = pageRef;

http://git-wip-us.apache.org/repos/asf/syncope/blob/13f96e06/client/console/src/main/java/org/apache/syncope/client/console/panels/AbstractSearchResultPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/AbstractSearchResultPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/AbstractSearchResultPanel.java
index c55d6bd..68bafbe 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/AbstractSearchResultPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/AbstractSearchResultPanel.java
@@ -41,7 +41,6 @@ import org.apache.wicket.markup.html.form.DropDownChoice;
 import org.apache.wicket.markup.html.form.Form;
 import org.apache.wicket.markup.html.panel.Panel;
 import org.apache.wicket.model.PropertyModel;
-import org.apache.wicket.spring.injection.annot.SpringBean;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -49,16 +48,12 @@ public abstract class AbstractSearchResultPanel<T extends AnyTO> extends Panel i
 
     private static final long serialVersionUID = -9170191461250434024L;
 
-    /**
-     * Logger.
-     */
     protected static final Logger LOG = LoggerFactory.getLogger(AbstractSearchResultPanel.class);
 
     /**
      * Application preferences.
      */
-    @SpringBean
-    protected PreferenceManager prefMan;
+    protected PreferenceManager prefMan = new PreferenceManager();
 
     protected final AbstractAnyRestClient restClient;
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/13f96e06/client/console/src/main/java/org/apache/syncope/client/console/panels/AnySearchResultPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/AnySearchResultPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/AnySearchResultPanel.java
index 0940698..eacdb4f 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/AnySearchResultPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/AnySearchResultPanel.java
@@ -49,15 +49,13 @@ import org.apache.wicket.model.CompoundPropertyModel;
 import org.apache.wicket.model.IModel;
 import org.apache.wicket.model.Model;
 import org.apache.wicket.model.ResourceModel;
-import org.apache.wicket.spring.injection.annot.SpringBean;
 import org.springframework.util.ReflectionUtils;
 
 public class AnySearchResultPanel<T extends AnyTO> extends AbstractSearchResultPanel<T> {
 
     private static final long serialVersionUID = -1100228004207271270L;
 
-    @SpringBean
-    protected SchemaRestClient schemaRestClient;
+    protected final SchemaRestClient schemaRestClient = new SchemaRestClient();
 
     protected final List<String> schemaNames;
 
@@ -70,15 +68,16 @@ public class AnySearchResultPanel<T extends AnyTO> extends AbstractSearchResultP
     public AnySearchResultPanel(final String type, final String parentId, final boolean filtered,
             final String fiql, final PageReference callerRef, final AbstractAnyRestClient restClient,
             final List<AnyTypeClassTO> anyTypeClassTOs, final String realm) {
+
         super(parentId, filtered, fiql, callerRef, restClient, realm, type);
         //setCustomMarkupId(markupId);
         add(new Label("name", type));
 
-        this.schemaNames = new ArrayList<String>();
+        this.schemaNames = new ArrayList<>();
         for (AnyTypeClassTO anyTypeClassTO : anyTypeClassTOs) {
             this.schemaNames.addAll(anyTypeClassTO.getPlainSchemas());
         }
-        this.dSchemaNames = new ArrayList<String>();
+        this.dSchemaNames = new ArrayList<>();
         for (AnyTypeClassTO anyTypeClassTO : anyTypeClassTOs) {
             this.dSchemaNames.addAll(anyTypeClassTO.getDerSchemas());
         }

http://git-wip-us.apache.org/repos/asf/syncope/blob/13f96e06/client/console/src/main/java/org/apache/syncope/client/console/panels/ConnectorModal.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/ConnectorModal.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/ConnectorModal.java
index 349560c..2d981f6 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/ConnectorModal.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/ConnectorModal.java
@@ -28,6 +28,7 @@ import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.collections4.Predicate;
 import org.apache.syncope.client.console.commons.Constants;
 import org.apache.syncope.client.console.pages.AbstractBasePage;
+import org.apache.syncope.client.console.rest.ConnectorRestClient;
 import org.apache.syncope.client.console.topology.TopologyNode;
 import org.apache.syncope.client.console.wicket.markup.html.bootstrap.dialog.BaseModal;
 import org.apache.syncope.common.lib.to.ConnBundleTO;
@@ -48,6 +49,8 @@ public class ConnectorModal extends AbstractResourceModal {
 
     private static final long serialVersionUID = -2025535531121434050L;
 
+    private final ConnectorRestClient connectorRestClient = new ConnectorRestClient();
+
     private final List<ConnBundleTO> bundles;
 
     public ConnectorModal(

http://git-wip-us.apache.org/repos/asf/syncope/blob/13f96e06/client/console/src/main/java/org/apache/syncope/client/console/panels/GroupModalPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/GroupModalPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/GroupModalPanel.java
index 2e4caf5..9778881 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/GroupModalPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/GroupModalPanel.java
@@ -21,6 +21,7 @@ package org.apache.syncope.client.console.panels;
 import org.apache.commons.lang3.SerializationUtils;
 import org.apache.syncope.client.console.commons.Constants;
 import org.apache.syncope.client.console.commons.Mode;
+import org.apache.syncope.client.console.rest.GroupRestClient;
 import org.apache.syncope.client.console.wicket.markup.html.bootstrap.dialog.BaseModal;
 import org.apache.syncope.common.lib.to.GroupTO;
 import org.apache.wicket.PageReference;
@@ -39,6 +40,8 @@ public class GroupModalPanel extends AbstractModalPanel {
 
     private static final long serialVersionUID = -1732493223434085205L;
 
+    private final GroupRestClient groupRestClient = new GroupRestClient();
+
     protected final Mode mode;
 
     protected final boolean createFlag;
@@ -49,6 +52,7 @@ public class GroupModalPanel extends AbstractModalPanel {
 
     public GroupModalPanel(
             final BaseModal<?> modal, final PageReference pageRef, final GroupTO groupTO) {
+
         this(modal, pageRef, groupTO, Mode.ADMIN);
     }
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/13f96e06/client/console/src/main/java/org/apache/syncope/client/console/panels/Realm.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/Realm.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/Realm.java
index 68a0b79..bea0610 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/Realm.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/Realm.java
@@ -35,7 +35,6 @@ import org.apache.wicket.extensions.markup.html.tabs.AbstractTab;
 import org.apache.wicket.extensions.markup.html.tabs.ITab;
 import org.apache.wicket.markup.html.panel.Panel;
 import org.apache.wicket.model.Model;
-import org.apache.wicket.spring.injection.annot.SpringBean;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -49,17 +48,13 @@ public class Realm extends Panel {
 
     private final List<AnyTypeTO> anyTypeTOs;
 
-    @SpringBean
-    private AnyTypeRestClient anyTypeRestClient;
+    private final AnyTypeRestClient anyTypeRestClient = new AnyTypeRestClient();
 
-    @SpringBean
-    private UserRestClient userRestClient;
+    private final UserRestClient userRestClient = new UserRestClient();
 
-    @SpringBean
-    private GroupRestClient groupRestClient;
+    private final GroupRestClient groupRestClient = new GroupRestClient();
 
-    @SpringBean
-    private AnyObjectRestClient anyObjectRestClient;
+    private final AnyObjectRestClient anyObjectRestClient = new AnyObjectRestClient();
 
     @SuppressWarnings({ "unchecked", "unchecked" })
     public Realm(final String id, final RealmTO realmTO, final PageReference pageReference) {
@@ -120,7 +115,7 @@ public class Realm extends Panel {
                                 anyTypeTO.getClasses()), realmTO.getFullPath());
                 break;
             case ANY_OBJECT:
-                panel = new AnySearchResultPanel(anyTypeTO.getKey(), id,
+                panel = new AnySearchResultPanel<>(anyTypeTO.getKey(), id,
                         false, null, pageReference, anyObjectRestClient, anyTypeRestClient.getAnyTypeClass(
                                 anyTypeTO.getClasses()), realmTO.getFullPath());
                 break;

http://git-wip-us.apache.org/repos/asf/syncope/blob/13f96e06/client/console/src/main/java/org/apache/syncope/client/console/panels/RealmModalPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/RealmModalPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/RealmModalPanel.java
index 9ea299f..51c66e1 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/RealmModalPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/RealmModalPanel.java
@@ -31,18 +31,16 @@ import org.apache.wicket.PageReference;
 import org.apache.wicket.ajax.AjaxRequestTarget;
 import org.apache.wicket.authroles.authorization.strategies.role.metadata.MetaDataRoleAuthorizationStrategy;
 import org.apache.wicket.markup.html.form.Form;
-import org.apache.wicket.spring.injection.annot.SpringBean;
 
 public class RealmModalPanel extends AbstractModalPanel {
 
     private static final long serialVersionUID = -4285220460543213901L;
 
-    protected RealmTO realmTO;
+    private final RealmRestClient realmRestClient = new RealmRestClient();
 
-    private boolean newRealm = false;
+    private RealmTO realmTO;
 
-    @SpringBean
-    private RealmRestClient realmRestClient;
+    private boolean newRealm = false;
 
     private final String parentPath;
 
@@ -52,6 +50,7 @@ public class RealmModalPanel extends AbstractModalPanel {
             final RealmTO realmTO,
             final String parentPath,
             final String entitlement) {
+
         this(modal, pageRef, realmTO, parentPath, entitlement, false);
     }
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/13f96e06/client/console/src/main/java/org/apache/syncope/client/console/panels/RealmSidebarPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/RealmSidebarPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/RealmSidebarPanel.java
index 221a05b..eb899c9 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/RealmSidebarPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/RealmSidebarPanel.java
@@ -44,14 +44,12 @@ import org.apache.wicket.markup.html.panel.Fragment;
 import org.apache.wicket.markup.html.panel.Panel;
 import org.apache.wicket.markup.repeater.RepeatingView;
 import org.apache.wicket.model.PropertyModel;
-import org.apache.wicket.spring.injection.annot.SpringBean;
 
 public class RealmSidebarPanel extends Panel {
 
     private static final long serialVersionUID = -1100228004207271270L;
 
-    @SpringBean
-    private RealmRestClient realmRestClient;
+    private final RealmRestClient realmRestClient = new RealmRestClient();
 
     private final WebMarkupContainer menu;
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/13f96e06/client/console/src/main/java/org/apache/syncope/client/console/panels/ResourceConnConfPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/ResourceConnConfPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/ResourceConnConfPanel.java
index cdce531..dbb3f37 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/ResourceConnConfPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/ResourceConnConfPanel.java
@@ -26,14 +26,12 @@ import org.apache.syncope.client.console.rest.ConnectorRestClient;
 import org.apache.syncope.common.lib.to.ResourceTO;
 import org.apache.syncope.common.lib.types.ConnConfProperty;
 import org.apache.wicket.model.IModel;
-import org.apache.wicket.spring.injection.annot.SpringBean;
 
 public abstract class ResourceConnConfPanel extends AbstractConnectorConfPanel<ResourceTO> {
 
     private static final long serialVersionUID = -7982691107029848579L;
 
-    @SpringBean
-    private ConnectorRestClient restClient;
+    private ConnectorRestClient restClient = new ConnectorRestClient();
 
     private final boolean createFlag;
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/13f96e06/client/console/src/main/java/org/apache/syncope/client/console/panels/ResourceMappingPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/ResourceMappingPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/ResourceMappingPanel.java
index cdc3fc0..330a4c2 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/ResourceMappingPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/ResourceMappingPanel.java
@@ -60,7 +60,6 @@ import org.apache.wicket.markup.html.panel.Panel;
 import org.apache.wicket.model.Model;
 import org.apache.wicket.model.PropertyModel;
 import org.apache.wicket.model.ResourceModel;
-import org.apache.wicket.spring.injection.annot.SpringBean;
 
 /**
  * Resource mapping panel.
@@ -87,14 +86,12 @@ public class ResourceMappingPanel extends Panel {
     /**
      * Schema rest client.
      */
-    @SpringBean
-    private SchemaRestClient schemaRestClient;
+    private final SchemaRestClient schemaRestClient = new SchemaRestClient();
 
     /**
      * ConnInstance rest client.
      */
-    @SpringBean
-    private ConnectorRestClient connRestClient;
+    private final ConnectorRestClient connRestClient = new ConnectorRestClient();
 
     /**
      * Resource schema name.


Mime
View raw message