You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by jd...@apache.org on 2009/02/22 14:47:51 UTC

svn commit: r746685 - /wicket/trunk/wicket/src/main/java/org/apache/wicket/Application.java

Author: jdonnerstag
Date: Sun Feb 22 13:47:51 2009
New Revision: 746685

URL: http://svn.apache.org/viewvc?rev=746685&view=rev
Log:
fixed WICKET-2118 Application adds a ComponentInstantiationListener that I don't want and can't remove

Modified:
    wicket/trunk/wicket/src/main/java/org/apache/wicket/Application.java

Modified: wicket/trunk/wicket/src/main/java/org/apache/wicket/Application.java
URL: http://svn.apache.org/viewvc/wicket/trunk/wicket/src/main/java/org/apache/wicket/Application.java?rev=746685&r1=746684&r2=746685&view=diff
==============================================================================
--- wicket/trunk/wicket/src/main/java/org/apache/wicket/Application.java (original)
+++ wicket/trunk/wicket/src/main/java/org/apache/wicket/Application.java Sun Feb 22 13:47:51 2009
@@ -275,6 +275,15 @@
 		// Create shared resources repository
 		sharedResources = new SharedResources(this);
 
+		// TODO why not move to internalInit??
+		initializeComponentInstantiationListener();
+	}
+
+	/**
+	 * Initialize the ComponentInstantiationListener. Subclasses may enhance or replace it
+	 */
+	protected void initializeComponentInstantiationListener()
+	{
 		// Install default component instantiation listener that uses
 		// authorization strategy to check component instantiations.
 		addComponentInstantiationListener(new IComponentInstantiationListener()
@@ -285,6 +294,7 @@
 			public void onInstantiation(final Component component)
 			{
 				final Class<? extends Component> cl = component.getClass();
+
 				// If component instantiation is not authorized
 				if (!Session.get().getAuthorizationStrategy().isInstantiationAuthorized(cl))
 				{