You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by eh...@apache.org on 2006/10/15 16:15:43 UTC
svn commit: r464199 - in
/incubator/wicket/trunk/wicket/src/main/java/wicket: ./ jmx/
Author: ehillenius
Date: Sun Oct 15 07:15:41 2006
New Revision: 464199
URL: http://svn.apache.org/viewvc?view=rev&rev=464199
Log:
added JMX support for Wicket 2.0
Added:
incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/
incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/Application.java
incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/ApplicationMBean.java
incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/ApplicationSettings.java
incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/ApplicationSettingsMBean.java
incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/CookieValuePersisterSettings.java
incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/CookieValuePersisterSettingsMBean.java
incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/DebugSettings.java
incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/DebugSettingsMBean.java
incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/Initializer.java
incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/MarkupSettings.java
incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/MarkupSettingsMBean.java
incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/PageSettings.java
incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/PageSettingsMBean.java
incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/RequestCycleSettings.java
incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/RequestCycleSettingsMBean.java
incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/RequestLogger.java
incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/RequestLoggerMBean.java
incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/ResourceSettings.java
incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/ResourceSettingsMBean.java
incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/SecuritySettings.java
incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/SecuritySettingsMBean.java
incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/SessionSettings.java
incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/SessionSettingsMBean.java
incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/Stringz.java
Modified:
incubator/wicket/trunk/wicket/src/main/java/wicket/Initializer.java
Modified: incubator/wicket/trunk/wicket/src/main/java/wicket/Initializer.java
URL: http://svn.apache.org/viewvc/incubator/wicket/trunk/wicket/src/main/java/wicket/Initializer.java?view=diff&rev=464199&r1=464198&r2=464199
==============================================================================
--- incubator/wicket/trunk/wicket/src/main/java/wicket/Initializer.java (original)
+++ incubator/wicket/trunk/wicket/src/main/java/wicket/Initializer.java Sun Oct 15 07:15:41 2006
@@ -46,5 +46,8 @@
IOnChangeListener.INTERFACE.register();
IRedirectListener.INTERFACE.register();
IResourceListener.INTERFACE.register();
+
+ // register JMX beans
+ new wicket.jmx.Initializer().init(application);
}
}
Added: incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/Application.java
URL: http://svn.apache.org/viewvc/incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/Application.java?view=auto&rev=464199
==============================================================================
--- incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/Application.java (added)
+++ incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/Application.java Sun Oct 15 07:15:41 2006
@@ -0,0 +1,126 @@
+/*
+ * ==============================================================================
+ * Licensed 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 wicket.jmx;
+
+import java.io.IOException;
+
+import wicket.protocol.http.WebApplication;
+import wicket.request.IRequestCodingStrategy;
+import wicket.request.IRequestTargetMountsInfo;
+import wicket.request.target.coding.IRequestTargetUrlCodingStrategy;
+
+/**
+ * Exposes Application related functionality for JMX.
+ *
+ * @author eelcohillenius
+ */
+public class Application implements ApplicationMBean
+{
+ private final wicket.Application application;
+
+ private final WebApplication webApplication;
+
+ /**
+ * Create.
+ *
+ * @param application
+ */
+ public Application(wicket.Application application)
+ {
+ this.application = application;
+
+ // do this so that we don't have to cast all the time
+ if (application instanceof WebApplication)
+ {
+ this.webApplication = (WebApplication)application;
+ }
+ else
+ {
+ this.webApplication = null;
+ }
+ }
+
+ /**
+ * @see wicket.jmx.ApplicationMBean#clearMarkupCache()
+ */
+ public void clearMarkupCache() throws IOException
+ {
+ application.getMarkupCache().clear();
+ }
+
+ /**
+ * @see wicket.jmx.ApplicationMBean#getApplicationClass()
+ */
+ public String getApplicationClass() throws IOException
+ {
+ return application.getClass().getName();
+ }
+
+ /**
+ * @see wicket.jmx.ApplicationMBean#getConfigurationType()
+ */
+ public String getConfigurationType()
+ {
+ return application.getConfigurationType();
+ }
+
+ /**
+ * @see wicket.jmx.ApplicationMBean#getHomePageClass()
+ */
+ public String getHomePageClass() throws IOException
+ {
+ return application.getClass().getName();
+ }
+
+ /**
+ * @see wicket.jmx.ApplicationMBean#getMarkupCacheSize()
+ */
+ public int getMarkupCacheSize() throws IOException
+ {
+ return application.getMarkupCache().size();
+ }
+
+ /**
+ * @see wicket.jmx.ApplicationMBean#getMounts()
+ */
+ public String[] getMounts() throws IOException
+ {
+ if (webApplication != null)
+ {
+ IRequestCodingStrategy mounter = webApplication.getRequestCycleProcessor()
+ .getRequestCodingStrategy();
+ if (mounter instanceof IRequestTargetMountsInfo)
+ {
+ IRequestTargetMountsInfo mountsInfo = (IRequestTargetMountsInfo)mounter;
+ IRequestTargetUrlCodingStrategy[] targets = mountsInfo.listMounts();
+ String[] results = new String[targets.length];
+ for (int i = 0; i < targets.length; i++)
+ {
+ results[i] = targets[i].getMountPath() + " - " + targets[i].toString();
+ }
+ return results;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * @see wicket.jmx.ApplicationMBean#getWicketVersion()
+ */
+ public String getWicketVersion() throws IOException
+ {
+ return application.getFrameworkSettings().getVersion();
+ }
+}
Added: incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/ApplicationMBean.java
URL: http://svn.apache.org/viewvc/incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/ApplicationMBean.java?view=auto&rev=464199
==============================================================================
--- incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/ApplicationMBean.java (added)
+++ incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/ApplicationMBean.java Sun Oct 15 07:15:41 2006
@@ -0,0 +1,94 @@
+/*
+ * ==============================================================================
+ * Licensed 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 wicket.jmx;
+
+import java.io.IOException;
+
+import wicket.Application;
+
+/**
+ * MBean interface for exposing application related information and
+ * functionality.
+ *
+ * @author eelcohillenius
+ */
+public interface ApplicationMBean
+{
+ /**
+ * Clears the markup cache, so that templates and properties etc will be
+ * reloaded the next time they are requested.
+ *
+ * @throws IOException
+ */
+ void clearMarkupCache() throws IOException;
+
+ /**
+ * Gets the class of the application.
+ *
+ * @return the class of the application
+ * @throws IOException
+ */
+ String getApplicationClass() throws IOException;
+
+ /**
+ * The configuration type, either {@link wicket.Application#DEVELOPMENT} or
+ * {@link Application#DEPLOYMENT}.
+ *
+ * @return The configuration type
+ */
+ String getConfigurationType();
+
+ /**
+ * Gets the configured home page for this application.
+ *
+ * @return the configured home page for this application
+ * @throws IOException
+ */
+ String getHomePageClass() throws IOException;
+
+ /**
+ * Gets the number of elements currently in the markup cache.
+ *
+ * @return the number of elements currently in the markup cache
+ * @throws IOException
+ */
+ int getMarkupCacheSize() throws IOException;
+
+ /**
+ * Lists the registered URL mounts.
+ *
+ * @return the registered URL mounts
+ * @throws IOException
+ */
+ String[] getMounts() throws IOException;
+
+ /**
+ * Gets the Wicket version. The Wicket version is in the same format as the
+ * version element in the pom.xml file (project descriptor). The version is
+ * generated by maven in the build/release cycle and put in the
+ * wicket.properties file located in the root folder of the Wicket jar.
+ *
+ * The version usually follows one of the following formats:
+ * <ul>
+ * <li>major.minor[.bug] for stable versions. 1.1, 1.2, 1.2.1 are examples</li>
+ * <li>major.minor-state for development versions. 1.2-beta2, 1.3-SNAPSHOT
+ * are examples</li>
+ * </ul>
+ *
+ * @return the Wicket version
+ * @throws IOException
+ */
+ String getWicketVersion() throws IOException;
+}
Added: incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/ApplicationSettings.java
URL: http://svn.apache.org/viewvc/incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/ApplicationSettings.java?view=auto&rev=464199
==============================================================================
--- incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/ApplicationSettings.java (added)
+++ incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/ApplicationSettings.java Sun Oct 15 07:15:41 2006
@@ -0,0 +1,93 @@
+/*
+ * ==============================================================================
+ * Licensed 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 wicket.jmx;
+
+import wicket.util.lang.Classes;
+
+/**
+ * Exposes Application related functionality for JMX.
+ *
+ * @author eelcohillenius
+ */
+public class ApplicationSettings implements ApplicationSettingsMBean
+{
+ private final wicket.Application application;
+
+ /**
+ * Create.
+ *
+ * @param application
+ */
+ public ApplicationSettings(wicket.Application application)
+ {
+ this.application = application;
+ }
+
+ /**
+ * @see wicket.jmx.ApplicationSettingsMBean#getAccessDeniedPage()
+ */
+ public String getAccessDeniedPage()
+ {
+ return Classes.name(application.getApplicationSettings().getAccessDeniedPage());
+ }
+
+ /**
+ * @see wicket.jmx.ApplicationSettingsMBean#getClassResolver()
+ */
+ public String getClassResolver()
+ {
+ return Stringz.className(application.getApplicationSettings().getClassResolver());
+ }
+
+ /**
+ * @see wicket.jmx.ApplicationSettingsMBean#getContextPath()
+ */
+ public String getContextPath()
+ {
+ return application.getApplicationSettings().getContextPath();
+ }
+
+ /**
+ * @see wicket.jmx.ApplicationSettingsMBean#getConverterFactory()
+ */
+ public String getConverterLocatorFactory()
+ {
+ return Stringz.className(application.getApplicationSettings().getConverterLocatorFactory());
+ }
+
+ /**
+ * @see wicket.jmx.ApplicationSettingsMBean#getInternalErrorPage()
+ */
+ public String getInternalErrorPage()
+ {
+ return Classes.name(application.getApplicationSettings().getInternalErrorPage());
+ }
+
+ /**
+ * @see wicket.jmx.ApplicationSettingsMBean#getPageExpiredErrorPage()
+ */
+ public String getPageExpiredErrorPage()
+ {
+ return Classes.name(application.getApplicationSettings().getPageExpiredErrorPage());
+ }
+
+ /**
+ * @see wicket.jmx.ApplicationSettingsMBean#getUnexpectedExceptionDisplay()
+ */
+ public String getUnexpectedExceptionDisplay()
+ {
+ return application.getApplicationSettings().getUnexpectedExceptionDisplay().toString();
+ }
+}
Added: incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/ApplicationSettingsMBean.java
URL: http://svn.apache.org/viewvc/incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/ApplicationSettingsMBean.java?view=auto&rev=464199
==============================================================================
--- incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/ApplicationSettingsMBean.java (added)
+++ incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/ApplicationSettingsMBean.java Sun Oct 15 07:15:41 2006
@@ -0,0 +1,85 @@
+/*
+ * ==============================================================================
+ * Licensed 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 wicket.jmx;
+
+import wicket.settings.IApplicationSettings;
+
+/**
+ * Application settings.
+ *
+ * @author eelcohillenius
+ */
+public interface ApplicationSettingsMBean
+{
+ /**
+ * Gets the access denied page class.
+ *
+ * @return Returns the accessDeniedPage.
+ * @see IApplicationSettings#setAccessDeniedPage(Class)
+ */
+ String getAccessDeniedPage();
+
+ /**
+ * Gets the default resolver to use when finding classes
+ *
+ * @return Default class resolver
+ */
+ String getClassResolver();
+
+ /**
+ * Gets context path to use for absolute path generation. For example an
+ * Application Server that is used as a virtual server on a Webserver:
+ *
+ * <pre>
+ * appserver.com/context mapped to webserver/ (context path should be '/')
+ * </pre>
+ *
+ * @return The context path
+ *
+ * @see IApplicationSettings#setContextPath(String) what the possible values
+ * can be.
+ */
+ String getContextPath();
+
+ /**
+ * Gets the converter locator factory.
+ *
+ * @return the converter locator factory
+ */
+ String getConverterLocatorFactory();
+
+ /**
+ * Gets internal error page class.
+ *
+ * @return Returns the internalErrorPage.
+ * @see IApplicationSettings#setInternalErrorPage(Class)
+ */
+ String getInternalErrorPage();
+
+ /**
+ * Gets the page expired page class.
+ *
+ * @return Returns the pageExpiredErrorPage.
+ * @see IApplicationSettings#setPageExpiredErrorPage(Class)
+ */
+ String getPageExpiredErrorPage();
+
+ /**
+ * Gets the unexpected exception display.
+ *
+ * @return the unexpected exception display
+ */
+ String getUnexpectedExceptionDisplay();
+}
Added: incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/CookieValuePersisterSettings.java
URL: http://svn.apache.org/viewvc/incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/CookieValuePersisterSettings.java?view=auto&rev=464199
==============================================================================
--- incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/CookieValuePersisterSettings.java (added)
+++ incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/CookieValuePersisterSettings.java Sun Oct 15 07:15:41 2006
@@ -0,0 +1,115 @@
+/*
+ * ==============================================================================
+ * Licensed 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 wicket.jmx;
+
+/**
+ * Exposes Application related functionality for JMX.
+ *
+ * @author eelcohillenius
+ */
+public class CookieValuePersisterSettings implements CookieValuePersisterSettingsMBean
+{
+ private final wicket.Application application;
+
+ /**
+ * Create.
+ *
+ * @param application
+ */
+ public CookieValuePersisterSettings(wicket.Application application)
+ {
+ this.application = application;
+ }
+
+ /**
+ * @see wicket.jmx.CookieValuePersisterSettingsMBean#getComment()
+ */
+ public String getComment()
+ {
+ return application.getSecuritySettings().getCookieValuePersisterSettings().getComment();
+ }
+
+ /**
+ * @see wicket.jmx.CookieValuePersisterSettingsMBean#getDomain()
+ */
+ public String getDomain()
+ {
+ return application.getSecuritySettings().getCookieValuePersisterSettings().getDomain();
+ }
+
+ /**
+ * @see wicket.jmx.CookieValuePersisterSettingsMBean#getMaxAge()
+ */
+ public int getMaxAge()
+ {
+ return application.getSecuritySettings().getCookieValuePersisterSettings().getMaxAge();
+ }
+
+ /**
+ * @see wicket.jmx.CookieValuePersisterSettingsMBean#getSecure()
+ */
+ public boolean getSecure()
+ {
+ return application.getSecuritySettings().getCookieValuePersisterSettings().getSecure();
+ }
+
+ /**
+ * @see wicket.jmx.CookieValuePersisterSettingsMBean#getVersion()
+ */
+ public int getVersion()
+ {
+ return application.getSecuritySettings().getCookieValuePersisterSettings().getVersion();
+ }
+
+ /**
+ * @see wicket.jmx.CookieValuePersisterSettingsMBean#setComment(java.lang.String)
+ */
+ public void setComment(String comment)
+ {
+ application.getSecuritySettings().getCookieValuePersisterSettings().setComment(comment);
+ }
+
+ /**
+ * @see wicket.jmx.CookieValuePersisterSettingsMBean#setDomain(java.lang.String)
+ */
+ public void setDomain(String domain)
+ {
+ application.getSecuritySettings().getCookieValuePersisterSettings().setDomain(domain);
+ }
+
+ /**
+ * @see wicket.jmx.CookieValuePersisterSettingsMBean#setMaxAge(int)
+ */
+ public void setMaxAge(int maxAge)
+ {
+ application.getSecuritySettings().getCookieValuePersisterSettings().setMaxAge(maxAge);
+ }
+
+ /**
+ * @see wicket.jmx.CookieValuePersisterSettingsMBean#setSecure(boolean)
+ */
+ public void setSecure(boolean secure)
+ {
+ application.getSecuritySettings().getCookieValuePersisterSettings().setSecure(secure);
+ }
+
+ /**
+ * @see wicket.jmx.CookieValuePersisterSettingsMBean#setVersion(int)
+ */
+ public void setVersion(int version)
+ {
+ application.getSecuritySettings().getCookieValuePersisterSettings().setVersion(version);
+ }
+}
Added: incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/CookieValuePersisterSettingsMBean.java
URL: http://svn.apache.org/viewvc/incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/CookieValuePersisterSettingsMBean.java?view=auto&rev=464199
==============================================================================
--- incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/CookieValuePersisterSettingsMBean.java (added)
+++ incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/CookieValuePersisterSettingsMBean.java Sun Oct 15 07:15:41 2006
@@ -0,0 +1,111 @@
+/*
+ * ==============================================================================
+ * Licensed 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 wicket.jmx;
+
+/**
+ * Cookie persister settings.
+ *
+ * @author eelcohillenius
+ */
+public interface CookieValuePersisterSettingsMBean
+{
+ /**
+ * Gets the cookie comment.
+ *
+ * @return the cookie comment
+ */
+ String getComment();
+
+ /**
+ * Gets the cookie domain name.
+ *
+ * @return the cookie domain name
+ */
+ String getDomain();
+
+ /**
+ * Gets the max age. After
+ *
+ * @return the max age
+ */
+ int getMaxAge();
+
+ /**
+ * Returns true if the browser is sending cookies only over a secure
+ * protocol, or false if the browser can send cookies using any protocol.
+ *
+ * @return whether this cookie is secure
+ */
+ boolean getSecure();
+
+ /**
+ * Returns the version of the protocol this cookie complies with. Version 1
+ * complies with RFC 2109, and version 0 complies with the original cookie
+ * specification drafted by Netscape. Cookies provided by a browser use and
+ * identify the browser's cookie version.
+ *
+ * @return 0 if the cookie complies with the original Netscape
+ * specification; 1 if the cookie complies with RFC 2109
+ */
+ int getVersion();
+
+ /**
+ * Sets the cookie comment.
+ *
+ * @param comment
+ * the cookie comment
+ */
+ void setComment(String comment);
+
+ /**
+ * Sets the cookie domain name.
+ *
+ * @param domain
+ * the cookie domain name
+ */
+ void setDomain(String domain);
+
+ /**
+ * Sets the maximum age of the cookie in seconds.
+ *
+ * @param maxAge
+ * the max age in secs.
+ */
+ void setMaxAge(int maxAge);
+
+ /**
+ * Indicates to the browser whether the cookie should only be sent using a
+ * secure protocol, such as HTTPS or SSL.
+ *
+ * @param secure
+ * if true, sends the cookie from the browser to the server using
+ * only when using a secure protocol; if false, sent on any
+ * protocol
+ */
+ void setSecure(boolean secure);
+
+ /**
+ * Sets the version of the cookie protocol this cookie complies with.
+ * Version 0 complies with the original Netscape cookie specification.
+ * Version 1 complies with RFC 2109. <br/>Since RFC 2109 is still somewhat
+ * new, consider version 1 as experimental; do not use it yet on production
+ * sites.
+ *
+ * @param version
+ * 0 if the cookie should comply with the original Netscape
+ * specification; 1 if the cookie should comply with RFC 2109
+ */
+ void setVersion(int version);
+}
Added: incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/DebugSettings.java
URL: http://svn.apache.org/viewvc/incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/DebugSettings.java?view=auto&rev=464199
==============================================================================
--- incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/DebugSettings.java (added)
+++ incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/DebugSettings.java Sun Oct 15 07:15:41 2006
@@ -0,0 +1,84 @@
+/*
+ * ==============================================================================
+ * Licensed 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 wicket.jmx;
+
+
+/**
+ * Exposes Application related functionality for JMX.
+ *
+ * @author eelcohillenius
+ */
+public class DebugSettings implements DebugSettingsMBean
+{
+ private final wicket.Application application;
+
+ /**
+ * Create.
+ *
+ * @param application
+ */
+ public DebugSettings(wicket.Application application)
+ {
+ this.application = application;
+ }
+
+ /**
+ * @see wicket.jmx.DebugSettingsMBean#getComponentUseCheck()
+ */
+ public boolean getComponentUseCheck()
+ {
+ return application.getDebugSettings().getComponentUseCheck();
+ }
+
+ /**
+ * @see wicket.jmx.DebugSettingsMBean#getSerializeSessionAttributes()
+ */
+ public boolean getSerializeSessionAttributes()
+ {
+ return application.getDebugSettings().getSerializeSessionAttributes();
+ }
+
+ /**
+ * @see wicket.jmx.DebugSettingsMBean#isAjaxDebugModeEnabled()
+ */
+ public boolean isAjaxDebugModeEnabled()
+ {
+ return application.getDebugSettings().isAjaxDebugModeEnabled();
+ }
+
+ /**
+ * @see wicket.jmx.DebugSettingsMBean#setAjaxDebugModeEnabled(boolean)
+ */
+ public void setAjaxDebugModeEnabled(boolean enable)
+ {
+ application.getDebugSettings().setAjaxDebugModeEnabled(enable);
+ }
+
+ /**
+ * @see wicket.jmx.DebugSettingsMBean#setComponentUseCheck(boolean)
+ */
+ public void setComponentUseCheck(boolean check)
+ {
+ application.getDebugSettings().setComponentUseCheck(check);
+ }
+
+ /**
+ * @see wicket.jmx.DebugSettingsMBean#setSerializeSessionAttributes(boolean)
+ */
+ public void setSerializeSessionAttributes(boolean serialize)
+ {
+ application.getDebugSettings().setSerializeSessionAttributes(serialize);
+ }
+}
Added: incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/DebugSettingsMBean.java
URL: http://svn.apache.org/viewvc/incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/DebugSettingsMBean.java?view=auto&rev=464199
==============================================================================
--- incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/DebugSettingsMBean.java (added)
+++ incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/DebugSettingsMBean.java Sun Oct 15 07:15:41 2006
@@ -0,0 +1,66 @@
+/*
+ * ==============================================================================
+ * Licensed 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 wicket.jmx;
+
+import wicket.settings.IDebugSettings;
+
+/**
+ * Debug settings.
+ *
+ * @author eelcohillenius
+ */
+public interface DebugSettingsMBean
+{
+ /**
+ * @return true if componentUseCheck is enabled
+ */
+ boolean getComponentUseCheck();
+
+ /**
+ * @return true if serialize session attributes is enabled, false otherwise
+ */
+ boolean getSerializeSessionAttributes();
+
+ /**
+ * Returns status of ajax debug mode. See {@link IDebugSettings} for details
+ *
+ * @return true if ajax debug mode is enabled, false otherwise
+ *
+ */
+ boolean isAjaxDebugModeEnabled();
+
+ /**
+ * Enables or disables ajax debug mode. See {@link IDebugSettings} for
+ * details
+ *
+ * @param enable
+ *
+ */
+ void setAjaxDebugModeEnabled(boolean enable);
+
+ /**
+ * Sets componentUseCheck debug settings
+ *
+ * @param check
+ */
+ void setComponentUseCheck(boolean check);
+
+ /**
+ * Sets the seriaalize session attributes setting
+ *
+ * @param serialize
+ */
+ void setSerializeSessionAttributes(boolean serialize);
+}
Added: incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/Initializer.java
URL: http://svn.apache.org/viewvc/incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/Initializer.java?view=auto&rev=464199
==============================================================================
--- incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/Initializer.java (added)
+++ incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/Initializer.java Sun Oct 15 07:15:41 2006
@@ -0,0 +1,108 @@
+/*
+ * ==============================================================================
+ * Licensed 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 wicket.jmx;
+
+import java.lang.management.ManagementFactory;
+
+import javax.management.InstanceAlreadyExistsException;
+import javax.management.MBeanRegistrationException;
+import javax.management.MBeanServer;
+import javax.management.MalformedObjectNameException;
+import javax.management.NotCompliantMBeanException;
+import javax.management.ObjectName;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import wicket.IInitializer;
+import wicket.WicketRuntimeException;
+
+/**
+ * Registers Wicket's MBeans.
+ *
+ * @author eelcohillenius
+ */
+public class Initializer implements IInitializer
+{
+ private static Log log = LogFactory.getLog(Initializer.class);
+
+ /**
+ * @see wicket.IInitializer#init(wicket.Application)
+ */
+ public void init(wicket.Application application)
+ {
+ try
+ {
+ String name = application.getName();
+ MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
+
+ // register top level application object, but first check whether
+ // multiple instances of the same application (name) are running and
+ // if so adjust the name
+ String domain = "wicket.app." + name;
+ ObjectName appBeanName = new ObjectName(domain + ":type=Application");
+ String tempDomain = domain;
+ int i = 0;
+ while (mbs.isRegistered(appBeanName))
+ {
+ tempDomain = name + "-" + i;
+ appBeanName = new ObjectName(domain + ":type=Application");
+ }
+ name = tempDomain;
+
+ Application appBean = new Application(application);
+ mbs.registerMBean(appBean, appBeanName);
+
+ mbs.registerMBean(new ApplicationSettings(application), new ObjectName(domain
+ + ":type=Application,name=ApplicationSettings"));
+ mbs.registerMBean(new DebugSettings(application), new ObjectName(domain
+ + ":type=Application,name=DebugSettings"));
+ mbs.registerMBean(new MarkupSettings(application), new ObjectName(domain
+ + ":type=Application,name=MarkupSettings"));
+ mbs.registerMBean(new ResourceSettings(application), new ObjectName(domain
+ + ":type=Application,name=ResourceSettings"));
+ mbs.registerMBean(new PageSettings(application), new ObjectName(domain
+ + ":type=Application,name=PageSettings"));
+ mbs.registerMBean(new RequestCycleSettings(application), new ObjectName(domain
+ + ":type=Application,name=RequestCycleSettings"));
+ mbs.registerMBean(new SecuritySettings(application), new ObjectName(domain
+ + ":type=Application,name=SecuritySettings"));
+ mbs.registerMBean(new SessionSettings(application), new ObjectName(domain
+ + ":type=Application,name=SessionSettings"));
+ mbs.registerMBean(new CookieValuePersisterSettings(application), new ObjectName(domain
+ + ":type=Application,name=CookieValuePersisterSettings"));
+
+ RequestLogger sessionsBean = new RequestLogger(application);
+ ObjectName sessionsBeanName = new ObjectName(domain + ":type=RequestLogger");
+ mbs.registerMBean(sessionsBean, sessionsBeanName);
+ }
+ catch (MalformedObjectNameException e)
+ {
+ throw new WicketRuntimeException(e);
+ }
+ catch (InstanceAlreadyExistsException e)
+ {
+ throw new WicketRuntimeException(e);
+ }
+ catch (MBeanRegistrationException e)
+ {
+ throw new WicketRuntimeException(e);
+ }
+ catch (NotCompliantMBeanException e)
+ {
+ throw new WicketRuntimeException(e);
+ }
+ }
+}
Added: incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/MarkupSettings.java
URL: http://svn.apache.org/viewvc/incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/MarkupSettings.java?view=auto&rev=464199
==============================================================================
--- incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/MarkupSettings.java (added)
+++ incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/MarkupSettings.java Sun Oct 15 07:15:41 2006
@@ -0,0 +1,172 @@
+/*
+ * ==============================================================================
+ * Licensed 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 wicket.jmx;
+
+
+/**
+ * Exposes Application related functionality for JMX.
+ *
+ * @author eelcohillenius
+ */
+public class MarkupSettings implements MarkupSettingsMBean
+{
+ private final wicket.Application application;
+
+ /**
+ * Create.
+ *
+ * @param application
+ */
+ public MarkupSettings(wicket.Application application)
+ {
+ this.application = application;
+ }
+
+ /**
+ * @see wicket.jmx.MarkupSettingsMBean#getAutomaticLinking()
+ */
+ public boolean getAutomaticLinking()
+ {
+ return application.getMarkupSettings().getAutomaticLinking();
+ }
+
+ /**
+ * @see wicket.jmx.MarkupSettingsMBean#getCompressWhitespace()
+ */
+ public boolean getCompressWhitespace()
+ {
+ return application.getMarkupSettings().getCompressWhitespace();
+ }
+
+ /**
+ * @see wicket.jmx.MarkupSettingsMBean#getDefaultAfterDisabledLink()
+ */
+ public String getDefaultAfterDisabledLink()
+ {
+ return application.getMarkupSettings().getDefaultAfterDisabledLink();
+ }
+
+ /**
+ * @see wicket.jmx.MarkupSettingsMBean#getDefaultBeforeDisabledLink()
+ */
+ public String getDefaultBeforeDisabledLink()
+ {
+ return application.getMarkupSettings().getDefaultBeforeDisabledLink();
+ }
+
+ /**
+ * @see wicket.jmx.MarkupSettingsMBean#getDefaultMarkupEncoding()
+ */
+ public String getDefaultMarkupEncoding()
+ {
+ return application.getMarkupSettings().getDefaultMarkupEncoding();
+ }
+
+ /**
+ * @see wicket.jmx.MarkupSettingsMBean#getMarkupParserFactory()
+ */
+ public String getMarkupParserFactory()
+ {
+ return Stringz.className(application.getMarkupSettings().getMarkupParserFactory());
+ }
+
+ /**
+ * @see wicket.jmx.MarkupSettingsMBean#getStripComments()
+ */
+ public boolean getStripComments()
+ {
+ return application.getMarkupSettings().getStripComments();
+ }
+
+ /**
+ * @see wicket.jmx.MarkupSettingsMBean#getStripWicketTags()
+ */
+ public boolean getStripWicketTags()
+ {
+ return application.getMarkupSettings().getStripWicketTags();
+ }
+
+ /**
+ * @see wicket.jmx.MarkupSettingsMBean#getStripXmlDeclarationFromOutput()
+ */
+ public boolean getStripXmlDeclarationFromOutput()
+ {
+ return application.getMarkupSettings().getStripXmlDeclarationFromOutput();
+ }
+
+ /**
+ * @see wicket.jmx.MarkupSettingsMBean#setAutomaticLinking(boolean)
+ */
+ public void setAutomaticLinking(boolean automaticLinking)
+ {
+ application.getMarkupSettings().setAutomaticLinking(automaticLinking);
+ }
+
+ /**
+ * @see wicket.jmx.MarkupSettingsMBean#setCompressWhitespace(boolean)
+ */
+ public void setCompressWhitespace(boolean compressWhitespace)
+ {
+ application.getMarkupSettings().setCompressWhitespace(compressWhitespace);
+ }
+
+ /**
+ * @see wicket.jmx.MarkupSettingsMBean#setDefaultAfterDisabledLink(java.lang.String)
+ */
+ public void setDefaultAfterDisabledLink(String defaultAfterDisabledLink)
+ {
+ application.getMarkupSettings().setDefaultAfterDisabledLink(defaultAfterDisabledLink);
+ }
+
+ /**
+ * @see wicket.jmx.MarkupSettingsMBean#setDefaultBeforeDisabledLink(java.lang.String)
+ */
+ public void setDefaultBeforeDisabledLink(String defaultBeforeDisabledLink)
+ {
+ application.getMarkupSettings().setDefaultBeforeDisabledLink(defaultBeforeDisabledLink);
+ }
+
+ /**
+ * @see wicket.jmx.MarkupSettingsMBean#setDefaultMarkupEncoding(java.lang.String)
+ */
+ public void setDefaultMarkupEncoding(String encoding)
+ {
+ application.getMarkupSettings().setDefaultMarkupEncoding(encoding);
+ }
+
+ /**
+ * @see wicket.jmx.MarkupSettingsMBean#setStripComments(boolean)
+ */
+ public void setStripComments(boolean stripComments)
+ {
+ application.getMarkupSettings().setStripComments(stripComments);
+ }
+
+ /**
+ * @see wicket.jmx.MarkupSettingsMBean#setStripWicketTags(boolean)
+ */
+ public void setStripWicketTags(boolean stripWicketTags)
+ {
+ application.getMarkupSettings().setStripWicketTags(stripWicketTags);
+ }
+
+ /**
+ * @see wicket.jmx.MarkupSettingsMBean#setStripXmlDeclarationFromOutput(boolean)
+ */
+ public void setStripXmlDeclarationFromOutput(boolean strip)
+ {
+ application.getMarkupSettings().setStripXmlDeclarationFromOutput(strip);
+ }
+}
Added: incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/MarkupSettingsMBean.java
URL: http://svn.apache.org/viewvc/incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/MarkupSettingsMBean.java?view=auto&rev=464199
==============================================================================
--- incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/MarkupSettingsMBean.java (added)
+++ incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/MarkupSettingsMBean.java Sun Oct 15 07:15:41 2006
@@ -0,0 +1,153 @@
+/*
+ * ==============================================================================
+ * Licensed 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 wicket.jmx;
+
+import wicket.settings.IMarkupSettings;
+
+/**
+ * Markup settings.
+ *
+ * @author eelcohillenius
+ */
+public interface MarkupSettingsMBean
+{
+ /**
+ * If true, automatic link resolution is enabled. Disabled by default.
+ *
+ * @see wicket.markup.resolver.AutoLinkResolver
+ * @see wicket.markup.parser.filter.WicketLinkTagHandler
+ * @return Returns the automaticLinking.
+ */
+ boolean getAutomaticLinking();
+
+ /**
+ * @return Returns the compressWhitespace.
+ * @see IMarkupSettings#setCompressWhitespace(boolean)
+ */
+ boolean getCompressWhitespace();
+
+ /**
+ * @return Returns the defaultAfterDisabledLink.
+ */
+ String getDefaultAfterDisabledLink();
+
+ /**
+ * @return Returns the defaultBeforeDisabledLink.
+ */
+ String getDefaultBeforeDisabledLink();
+
+ /**
+ * @since 1.1
+ * @return Returns default encoding of markup files. If null, the operating
+ * system provided encoding will be used.
+ */
+ String getDefaultMarkupEncoding();
+
+ /**
+ * @return markup parser factory
+ */
+ String getMarkupParserFactory();
+
+ /**
+ * @return Returns the stripComments.
+ * @see IMarkupSettings#setStripComments(boolean)
+ */
+ boolean getStripComments();
+
+ /**
+ * Gets whether to remove wicket tags from the output.
+ *
+ * @return whether to remove wicket tags from the output
+ */
+ boolean getStripWicketTags();
+
+ /**
+ * @return if true, xml declaration will be removed.
+ */
+ boolean getStripXmlDeclarationFromOutput();
+
+ /**
+ * Application default for automatic link resolution. Please
+ *
+ * @see wicket.markup.resolver.AutoLinkResolver and
+ * @see wicket.markup.parser.filter.WicketLinkTagHandler for more details.
+ *
+ * @param automaticLinking
+ * The automaticLinking to set.
+ */
+ void setAutomaticLinking(boolean automaticLinking);
+
+ /**
+ * Turns on whitespace compression. Multiple occurrences of space/tab
+ * characters will be compressed to a single space. Multiple line breaks
+ * newline/carriage-return will also be compressed to a single newline.
+ * <p>
+ * Compression is currently not HTML aware and so it may be possible for
+ * whitespace compression to break pages. For this reason, whitespace
+ * compression is off by default and you should test your application
+ * throroughly after turning whitespace compression on.
+ * <p>
+ * Spaces are removed from markup at markup load time and there should be no
+ * effect on page rendering speed. In fact, your pages should render faster
+ * with whitespace compression enabled.
+ *
+ * @param compressWhitespace
+ * The compressWhitespace to set.
+ */
+ void setCompressWhitespace(final boolean compressWhitespace);
+
+ /**
+ * @param defaultAfterDisabledLink
+ * The defaultAfterDisabledLink to set.
+ */
+ void setDefaultAfterDisabledLink(String defaultAfterDisabledLink);
+
+ /**
+ * @param defaultBeforeDisabledLink
+ * The defaultBeforeDisabledLink to set.
+ */
+ void setDefaultBeforeDisabledLink(String defaultBeforeDisabledLink);
+
+ /**
+ * Set default encoding for markup files. If null, the encoding provided by
+ * the operating system will be used.
+ *
+ * @param encoding
+ */
+ void setDefaultMarkupEncoding(final String encoding);
+
+ /**
+ * Enables stripping of markup comments denoted in markup by HTML comment
+ * tagging.
+ *
+ * @param stripComments
+ * True to strip markup comments from rendered pages
+ */
+ void setStripComments(boolean stripComments);
+
+ /**
+ * Sets whether to remove wicket tags from the output.
+ *
+ * @param stripWicketTags
+ * whether to remove wicket tags from the output
+ */
+ void setStripWicketTags(boolean stripWicketTags);
+
+ /**
+ * @param strip
+ * if true, xml declaration will be stripped from output
+ */
+ void setStripXmlDeclarationFromOutput(final boolean strip);
+}
Added: incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/PageSettings.java
URL: http://svn.apache.org/viewvc/incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/PageSettings.java?view=auto&rev=464199
==============================================================================
--- incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/PageSettings.java (added)
+++ incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/PageSettings.java Sun Oct 15 07:15:41 2006
@@ -0,0 +1,84 @@
+/*
+ * ==============================================================================
+ * Licensed 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 wicket.jmx;
+
+
+/**
+ * Exposes Application related functionality for JMX.
+ *
+ * @author eelcohillenius
+ */
+public class PageSettings implements PageSettingsMBean
+{
+ private final wicket.Application application;
+
+ /**
+ * Create.
+ *
+ * @param application
+ */
+ public PageSettings(wicket.Application application)
+ {
+ this.application = application;
+ }
+
+ /**
+ * @see wicket.jmx.PageSettingsMBean#getAutomaticMultiWindowSupport()
+ */
+ public boolean getAutomaticMultiWindowSupport()
+ {
+ return application.getPageSettings().getAutomaticMultiWindowSupport();
+ }
+
+ /**
+ * @see wicket.jmx.PageSettingsMBean#getMaxPageVersions()
+ */
+ public int getMaxPageVersions()
+ {
+ return application.getPageSettings().getMaxPageVersions();
+ }
+
+ /**
+ * @see wicket.jmx.PageSettingsMBean#getVersionPagesByDefault()
+ */
+ public boolean getVersionPagesByDefault()
+ {
+ return application.getPageSettings().getVersionPagesByDefault();
+ }
+
+ /**
+ * @see wicket.jmx.PageSettingsMBean#setAutomaticMultiWindowSupport(boolean)
+ */
+ public void setAutomaticMultiWindowSupport(boolean automaticMultiWindowSupport)
+ {
+ application.getPageSettings().setAutomaticMultiWindowSupport(automaticMultiWindowSupport);
+ }
+
+ /**
+ * @see wicket.jmx.PageSettingsMBean#setMaxPageVersions(int)
+ */
+ public void setMaxPageVersions(int maxPageVersions)
+ {
+ application.getPageSettings().setMaxPageVersions(maxPageVersions);
+ }
+
+ /**
+ * @see wicket.jmx.PageSettingsMBean#setVersionPagesByDefault(boolean)
+ */
+ public void setVersionPagesByDefault(boolean pagesVersionedByDefault)
+ {
+ application.getPageSettings().setVersionPagesByDefault(pagesVersionedByDefault);
+ }
+}
Added: incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/PageSettingsMBean.java
URL: http://svn.apache.org/viewvc/incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/PageSettingsMBean.java?view=auto&rev=464199
==============================================================================
--- incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/PageSettingsMBean.java (added)
+++ incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/PageSettingsMBean.java Sun Oct 15 07:15:41 2006
@@ -0,0 +1,92 @@
+/*
+ * ==============================================================================
+ * Licensed 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 wicket.jmx;
+
+import wicket.markup.html.WebPage;
+
+/**
+ * Page settings.
+ *
+ * @author eelcohillenius
+ */
+public interface PageSettingsMBean
+{
+ /**
+ * Gets whether Wicket should try to support opening multiple windows for
+ * the same session transparently. If this is true - the default setting -,
+ * Wicket tries to detect whether a new window was opened by a user (e.g. in
+ * Internet Explorer by pressing ctrl+n or ctrl+click on a link), and if it
+ * detects that, it creates a new page map for that window on the fly. As a
+ * page map represents the 'history' of one window, each window will then
+ * have their own history. If two windows would share the same page map, the
+ * non-bookmarkable links on one window could refer to stale state after
+ * working a while in the other window.
+ * <p>
+ * <strong> Currently, Wicket trying to do this is a best effort that is not
+ * completely fail safe. When the client does not support cookies, support
+ * gets tricky and incomplete. See {@link WebPage}'s internals for the
+ * implementation. </strong>
+ * </p>
+ *
+ * @return Whether Wicket should try to support multiple windows
+ * transparently
+ */
+ boolean getAutomaticMultiWindowSupport();
+
+ /**
+ * @return Returns the maxPageVersions.
+ */
+ int getMaxPageVersions();
+
+ /**
+ * @return Returns the pagesVersionedByDefault.
+ */
+ boolean getVersionPagesByDefault();
+
+ /**
+ * Sets whether Wicket should try to support opening multiple windows for
+ * the same session transparently. If this is true - the default setting -,
+ * Wicket tries to detect whether a new window was opened by a user (e.g. in
+ * Internet Explorer by pressing ctrl+n or ctrl+click on a link), and if it
+ * detects that, it creates a new page map for that window on the fly. As a
+ * page map represents the 'history' of one window, each window will then
+ * have their own history. If two windows would share the same page map, the
+ * non-bookmarkable links on one window could refer to stale state after
+ * working a while in the other window.
+ * <p>
+ * <strong> Currently, Wicket trying to do this is a best effort that is not
+ * completely fail safe. When the client does not support cookies, support
+ * gets tricky and incomplete. See {@link WebPage}'s internals for the
+ * implementation. </strong>
+ * </p>
+ *
+ * @param automaticMultiWindowSupport
+ * Whether Wicket should try to support multiple windows
+ * transparently
+ */
+ void setAutomaticMultiWindowSupport(boolean automaticMultiWindowSupport);
+
+ /**
+ * @param maxPageVersions
+ * The maxPageVersion to set.
+ */
+ void setMaxPageVersions(int maxPageVersions);
+
+ /**
+ * @param pagesVersionedByDefault
+ * The pagesVersionedByDefault to set.
+ */
+ void setVersionPagesByDefault(boolean pagesVersionedByDefault);
+}
Added: incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/RequestCycleSettings.java
URL: http://svn.apache.org/viewvc/incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/RequestCycleSettings.java?view=auto&rev=464199
==============================================================================
--- incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/RequestCycleSettings.java (added)
+++ incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/RequestCycleSettings.java Sun Oct 15 07:15:41 2006
@@ -0,0 +1,85 @@
+/*
+ * ==============================================================================
+ * Licensed 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 wicket.jmx;
+
+
+/**
+ * Exposes Application related functionality for JMX.
+ *
+ * @author eelcohillenius
+ */
+public class RequestCycleSettings implements RequestCycleSettingsMBean
+{
+ private final wicket.Application application;
+
+ /**
+ * Create.
+ *
+ * @param application
+ */
+ public RequestCycleSettings(wicket.Application application)
+ {
+ this.application = application;
+ }
+
+ /**
+ * @see wicket.jmx.RequestCycleSettingsMBean#getBufferResponse()
+ */
+ public boolean getBufferResponse()
+ {
+ return application.getRequestCycleSettings().getBufferResponse();
+ }
+
+ /**
+ * @see wicket.jmx.RequestCycleSettingsMBean#getGatherExtendedBrowserInfo()
+ */
+ public boolean getGatherExtendedBrowserInfo()
+ {
+ return application.getRequestCycleSettings().getGatherExtendedBrowserInfo();
+ }
+
+ /**
+ * @see wicket.jmx.RequestCycleSettingsMBean#getResponseRequestEncoding()
+ */
+ public String getResponseRequestEncoding()
+ {
+ return application.getRequestCycleSettings().getResponseRequestEncoding();
+ }
+
+ /**
+ * @see wicket.jmx.RequestCycleSettingsMBean#setBufferResponse(boolean)
+ */
+ public void setBufferResponse(boolean bufferResponse)
+ {
+ application.getRequestCycleSettings().setBufferResponse(bufferResponse);
+ }
+
+ /**
+ * @see wicket.jmx.RequestCycleSettingsMBean#setGatherExtendedBrowserInfo(boolean)
+ */
+ public void setGatherExtendedBrowserInfo(boolean gatherExtendedBrowserInfo)
+ {
+ application.getRequestCycleSettings().setGatherExtendedBrowserInfo(
+ gatherExtendedBrowserInfo);
+ }
+
+ /**
+ * @see wicket.jmx.RequestCycleSettingsMBean#setResponseRequestEncoding(java.lang.String)
+ */
+ public void setResponseRequestEncoding(String responseRequestEncoding)
+ {
+ application.getRequestCycleSettings().setResponseRequestEncoding(responseRequestEncoding);
+ }
+}
Added: incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/RequestCycleSettingsMBean.java
URL: http://svn.apache.org/viewvc/incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/RequestCycleSettingsMBean.java?view=auto&rev=464199
==============================================================================
--- incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/RequestCycleSettingsMBean.java (added)
+++ incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/RequestCycleSettingsMBean.java Sun Oct 15 07:15:41 2006
@@ -0,0 +1,85 @@
+/*
+ * ==============================================================================
+ * Licensed 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 wicket.jmx;
+
+import wicket.markup.html.pages.BrowserInfoPage;
+import wicket.protocol.http.WebRequestCycle;
+
+/**
+ * Request cycle settings.
+ *
+ * @author eelcohillenius
+ */
+public interface RequestCycleSettingsMBean
+{
+ /**
+ * @return True if this application buffers its responses
+ */
+ boolean getBufferResponse();
+
+ /**
+ * Gets whether Wicket should try to get extensive client info by
+ * redirecting to
+ * {@link BrowserInfoPage a page that polls for client capabilities}. This
+ * method is used by the default implementation of
+ * {@link WebRequestCycle#newClientInfo()}, so if that method is overriden,
+ * there is no guarantee this method will be taken into account.
+ *
+ * @return Whether to gather extensive client info
+ */
+ boolean getGatherExtendedBrowserInfo();
+
+ /**
+ * In order to do proper form parameter decoding it is important that the
+ * response and the following request have the same encoding. see
+ * http://www.crazysquirrel.com/computing/general/form-encoding.jspx for
+ * additional information.
+ *
+ * @return The request and response encoding
+ */
+ String getResponseRequestEncoding();
+
+ /**
+ * @param bufferResponse
+ * True if this application should buffer responses.
+ */
+ void setBufferResponse(boolean bufferResponse);
+
+ /**
+ * Sets whether Wicket should try to get extensive client info by
+ * redirecting to
+ * {@link BrowserInfoPage a page that polls for client capabilities}. This
+ * method is used by the default implementation of
+ * {@link WebRequestCycle#newClientInfo()}, so if that method is overriden,
+ * there is no guarantee this method will be taken into account.
+ *
+ * @param gatherExtendedBrowserInfo
+ * Whether to gather extensive client info
+ */
+ void setGatherExtendedBrowserInfo(boolean gatherExtendedBrowserInfo);
+
+ /**
+ * In order to do proper form parameter decoding it is important that the
+ * response and the following request have the same encoding. see
+ * http://www.crazysquirrel.com/computing/general/form-encoding.jspx for
+ * additional information.
+ *
+ * Default encoding: UTF-8
+ *
+ * @param responseRequestEncoding
+ * The request and response encoding to be used.
+ */
+ void setResponseRequestEncoding(final String responseRequestEncoding);
+}
Added: incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/RequestLogger.java
URL: http://svn.apache.org/viewvc/incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/RequestLogger.java?view=auto&rev=464199
==============================================================================
--- incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/RequestLogger.java (added)
+++ incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/RequestLogger.java Sun Oct 15 07:15:41 2006
@@ -0,0 +1,109 @@
+/*
+ * ==============================================================================
+ * Licensed 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 wicket.jmx;
+
+import java.io.IOException;
+
+import wicket.protocol.http.IRequestLogger;
+import wicket.protocol.http.RequestLogger.SessionData;
+
+/**
+ * Exposes {@link wicket.protocol.http.RequestLogger} for JMX.
+ *
+ * @author eelcohillenius
+ */
+public class RequestLogger implements RequestLoggerMBean
+{
+ private final wicket.Application application;
+
+ /**
+ * Construct.
+ *
+ * @param application
+ * The application
+ */
+ public RequestLogger(wicket.Application application)
+ {
+ this.application = application;
+ }
+
+ /**
+ * @see wicket.jmx.RequestLoggerMBean#getNumberOfCreatedSessions()
+ */
+ public Integer getNumberOfCreatedSessions() throws IOException
+ {
+ IRequestLogger logger = getRequestLogger();
+ if (logger != null)
+ {
+ return Integer.valueOf(logger.getTotalCreatedSessions());
+ }
+ return null;
+ }
+
+ /**
+ * @see wicket.jmx.RequestLoggerMBean#getNumberOfLiveSessions()
+ */
+ public Integer getNumberOfLiveSessions() throws IOException
+ {
+ IRequestLogger logger = getRequestLogger();
+ if (logger != null)
+ {
+ SessionData[] liveSessions = logger.getLiveSessions();
+ return (liveSessions != null) ? Integer.valueOf(liveSessions.length) : Integer
+ .valueOf(0);
+ }
+ return null;
+ }
+
+ /**
+ * @see wicket.jmx.RequestLoggerMBean#getPeakNumberOfSessions()
+ */
+ public Integer getPeakNumberOfSessions() throws IOException
+ {
+ IRequestLogger logger = getRequestLogger();
+ if (logger != null)
+ {
+ return Integer.valueOf(logger.getPeakSessions());
+ }
+ return null;
+ }
+
+ /**
+ * @see wicket.jmx.RequestLoggerMBean#restart()
+ */
+ public void restart() throws IOException
+ {
+ application.setRequestLogger(new wicket.protocol.http.RequestLogger());
+ }
+
+ /**
+ * @see wicket.jmx.RequestLoggerMBean#stop()
+ */
+ public void stop() throws IOException
+ {
+ application.setRequestLogger(null);
+ }
+
+ /**
+ * Gets the request logger for this application.
+ *
+ * @return The request logger or null if no request is active, or if this is
+ * not a web application
+ */
+ protected IRequestLogger getRequestLogger()
+ {
+ return application.getRequestLogger();
+ }
+}
Added: incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/RequestLoggerMBean.java
URL: http://svn.apache.org/viewvc/incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/RequestLoggerMBean.java?view=auto&rev=464199
==============================================================================
--- incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/RequestLoggerMBean.java (added)
+++ incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/RequestLoggerMBean.java Sun Oct 15 07:15:41 2006
@@ -0,0 +1,88 @@
+/*
+ * ==============================================================================
+ * Licensed 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 wicket.jmx;
+
+import java.io.IOException;
+
+import wicket.protocol.http.WebApplication;
+
+/**
+ * Interface for exposing the request logger.
+ *
+ * @author eelcohillenius
+ */
+public interface RequestLoggerMBean
+{
+ /**
+ * Total number of sessions ever created since the application was started.
+ * <p>
+ * Only available for {@link WebApplication web applications}.
+ * </p>
+ *
+ * @return the total number of sessions ever created since the application
+ * was started
+ * @throws IOException
+ */
+ Integer getNumberOfCreatedSessions() throws IOException;
+
+ /**
+ * Gets the (recorded) number of currently live sessions.
+ * <p>
+ * Only available for {@link WebApplication web applications}.
+ * </p>
+ *
+ * @return current (recorded) number of live sessions
+ * @throws IOException
+ */
+ Integer getNumberOfLiveSessions() throws IOException;
+
+ /**
+ * The largest number of concurrent sessions since the application was
+ * started.
+ * <p>
+ * Only available for {@link WebApplication web applications}.
+ * </p>
+ *
+ * @return the largest number of concurrent sessions since the application
+ * was started
+ * @throws IOException
+ */
+ Integer getPeakNumberOfSessions() throws IOException;
+
+ /**
+ * Registers a new request logger at the application. You need a request
+ * logger for some functions of the session bean. Be aware that sessions
+ * will be logged from this time on, so they may not reflect the actual
+ * number of sessions. Also, if one was registered, it will be replaced by a
+ * new one, which then starts over counting, disregarding the current ones.
+ * <p>
+ * Only available for {@link WebApplication web applications}.
+ * </p>
+ *
+ * @throws IOException
+ */
+ void restart() throws IOException;
+
+ /**
+ * Removes any set request logger from the application. You need a request
+ * logger for some functions of the session bean.
+ * <p>
+ * Only available for {@link WebApplication web applications}.
+ * </p>
+ *
+ * @throws IOException
+ */
+ void stop() throws IOException;
+}
Added: incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/ResourceSettings.java
URL: http://svn.apache.org/viewvc/incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/ResourceSettings.java?view=auto&rev=464199
==============================================================================
--- incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/ResourceSettings.java (added)
+++ incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/ResourceSettings.java Sun Oct 15 07:15:41 2006
@@ -0,0 +1,137 @@
+/*
+ * ==============================================================================
+ * Licensed 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 wicket.jmx;
+
+import java.util.List;
+
+import wicket.util.time.Duration;
+
+
+/**
+ * Exposes Application related functionality for JMX.
+ *
+ * @author eelcohillenius
+ */
+public class ResourceSettings implements ResourceSettingsMBean
+{
+ private final wicket.Application application;
+
+ /**
+ * Create.
+ *
+ * @param application
+ */
+ public ResourceSettings(wicket.Application application)
+ {
+ this.application = application;
+ }
+
+ /**
+ * @see wicket.jmx.ResourceSettingsMBean#getLocalizer()
+ */
+ public String getLocalizer()
+ {
+ return Stringz.className(application.getResourceSettings().getLocalizer());
+ }
+
+ /**
+ * @see wicket.jmx.ResourceSettingsMBean#getPackageResourceGuard()
+ */
+ public String getPackageResourceGuard()
+ {
+ return Stringz.className(application.getResourceSettings().getPackageResourceGuard());
+ }
+
+ /**
+ * @see wicket.jmx.ResourceSettingsMBean#getPropertiesFactory()
+ */
+ public String getPropertiesFactory()
+ {
+ return Stringz.className(application.getResourceSettings().getPropertiesFactory());
+ }
+
+ /**
+ * @see wicket.jmx.ResourceSettingsMBean#getResourceFinder()
+ */
+ public String getResourceFinder()
+ {
+ return Stringz.className(application.getResourceSettings().getResourceFinder());
+ }
+
+ /**
+ * @see wicket.jmx.ResourceSettingsMBean#getResourcePollFrequency()
+ */
+ public String getResourcePollFrequency()
+ {
+ Duration duration = application.getResourceSettings().getResourcePollFrequency();
+ return (duration != null) ? duration.toString() : null;
+ }
+
+ /**
+ * @see wicket.jmx.ResourceSettingsMBean#getResourceStreamLocator()
+ */
+ public String getResourceStreamLocator()
+ {
+ return Stringz.className(application.getResourceSettings().getResourceStreamLocator());
+ }
+
+ /**
+ * @see wicket.jmx.ResourceSettingsMBean#getStringResourceLoaders()
+ */
+ @SuppressWarnings("unchecked")
+ public String[] getStringResourceLoaders()
+ {
+ List loaders = application.getResourceSettings().getStringResourceLoaders();
+ if (loaders != null)
+ {
+ return (String[])loaders.toArray(new String[loaders.size()]);
+ }
+ return null;
+ }
+
+ /**
+ * @see wicket.jmx.ResourceSettingsMBean#getThrowExceptionOnMissingResource()
+ */
+ public boolean getThrowExceptionOnMissingResource()
+ {
+ return application.getResourceSettings().getThrowExceptionOnMissingResource();
+ }
+
+ /**
+ * @see wicket.jmx.ResourceSettingsMBean#getUseDefaultOnMissingResource()
+ */
+ public boolean getUseDefaultOnMissingResource()
+ {
+ return application.getResourceSettings().getUseDefaultOnMissingResource();
+ }
+
+ /**
+ * @see wicket.jmx.ResourceSettingsMBean#setThrowExceptionOnMissingResource(boolean)
+ */
+ public void setThrowExceptionOnMissingResource(boolean throwExceptionOnMissingResource)
+ {
+ application.getResourceSettings().setThrowExceptionOnMissingResource(
+ throwExceptionOnMissingResource);
+ }
+
+ /**
+ * @see wicket.jmx.ResourceSettingsMBean#setUseDefaultOnMissingResource(boolean)
+ */
+ public void setUseDefaultOnMissingResource(boolean useDefaultOnMissingResource)
+ {
+ application.getResourceSettings().setUseDefaultOnMissingResource(
+ useDefaultOnMissingResource);
+ }
+}
Added: incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/ResourceSettingsMBean.java
URL: http://svn.apache.org/viewvc/incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/ResourceSettingsMBean.java?view=auto&rev=464199
==============================================================================
--- incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/ResourceSettingsMBean.java (added)
+++ incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/ResourceSettingsMBean.java Sun Oct 15 07:15:41 2006
@@ -0,0 +1,100 @@
+/*
+ * ==============================================================================
+ * Licensed 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 wicket.jmx;
+
+import wicket.markup.html.PackageResourceGuard;
+import wicket.settings.IResourceSettings;
+import wicket.util.file.IResourceFinder;
+import wicket.util.time.Duration;
+
+/**
+ * Resource settings.
+ *
+ * @author eelcohillenius
+ */
+public interface ResourceSettingsMBean
+{
+ /**
+ * Get the application's localizer.
+ *
+ * @return The application wide localizer instance
+ */
+ String getLocalizer();
+
+ /**
+ * Gets the {@link PackageResourceGuard package resource guard}.
+ *
+ * @return The package resource guard
+ */
+ String getPackageResourceGuard();
+
+ /**
+ * Get the property factory which will be used to load property files
+ *
+ * @return PropertiesFactory
+ */
+ String getPropertiesFactory();
+
+ /**
+ * Gets the resource finder to use when searching for resources.
+ *
+ * @return Returns the resourceFinder.
+ * @see IResourceSettings#setResourceFinder(IResourceFinder)
+ */
+ String getResourceFinder();
+
+ /**
+ * @return Returns the resourcePollFrequency.
+ * @see IResourceSettings#setResourcePollFrequency(Duration)
+ */
+ String getResourcePollFrequency();
+
+ /**
+ * @return Resource locator for this application
+ */
+ String getResourceStreamLocator();
+
+ /**
+ * @return an unmodifiable list of all available string resource loaders
+ */
+ String[] getStringResourceLoaders();
+
+ /**
+ * @see wicket.settings.IExceptionSettings#getThrowExceptionOnMissingResource()
+ *
+ * @return boolean
+ */
+ boolean getThrowExceptionOnMissingResource();
+
+ /**
+ * @return Whether to use a default value (if available) when a missing
+ * resource is requested
+ */
+ boolean getUseDefaultOnMissingResource();
+
+ /**
+ * @see wicket.settings.IExceptionSettings#setThrowExceptionOnMissingResource(boolean)
+ *
+ * @param throwExceptionOnMissingResource
+ */
+ void setThrowExceptionOnMissingResource(final boolean throwExceptionOnMissingResource);
+
+ /**
+ * @param useDefaultOnMissingResource
+ * Whether to use a default value (if available) when a missing
+ * resource is requested
+ */
+ void setUseDefaultOnMissingResource(final boolean useDefaultOnMissingResource);
+}
Added: incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/SecuritySettings.java
URL: http://svn.apache.org/viewvc/incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/SecuritySettings.java?view=auto&rev=464199
==============================================================================
--- incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/SecuritySettings.java (added)
+++ incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/SecuritySettings.java Sun Oct 15 07:15:41 2006
@@ -0,0 +1,60 @@
+/*
+ * ==============================================================================
+ * Licensed 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 wicket.jmx;
+
+/**
+ * Exposes Application related functionality for JMX.
+ *
+ * @author eelcohillenius
+ */
+public class SecuritySettings implements SecuritySettingsMBean
+{
+ private final wicket.Application application;
+
+ /**
+ * Create.
+ *
+ * @param application
+ */
+ public SecuritySettings(wicket.Application application)
+ {
+ this.application = application;
+ }
+
+ /**
+ * @see wicket.jmx.SecuritySettingsMBean#getAuthorizationStrategy()
+ */
+ public String getAuthorizationStrategy()
+ {
+ return Stringz.className(application.getSecuritySettings().getAuthorizationStrategy());
+ }
+
+ /**
+ * @see wicket.jmx.SecuritySettingsMBean#getCryptFactory()
+ */
+ public String getCryptFactory()
+ {
+ return Stringz.className(application.getSecuritySettings().getCryptFactory());
+ }
+
+ /**
+ * @see wicket.jmx.SecuritySettingsMBean#getUnauthorizedComponentInstantiationListener()
+ */
+ public String getUnauthorizedComponentInstantiationListener()
+ {
+ return Stringz.className(application.getSecuritySettings()
+ .getUnauthorizedComponentInstantiationListener());
+ }
+}
Added: incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/SecuritySettingsMBean.java
URL: http://svn.apache.org/viewvc/incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/SecuritySettingsMBean.java?view=auto&rev=464199
==============================================================================
--- incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/SecuritySettingsMBean.java (added)
+++ incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/SecuritySettingsMBean.java Sun Oct 15 07:15:41 2006
@@ -0,0 +1,43 @@
+/*
+ * ==============================================================================
+ * Licensed 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 wicket.jmx;
+
+import wicket.authorization.IUnauthorizedComponentInstantiationListener;
+
+/**
+ * Security settings.
+ *
+ * @author eelcohillenius
+ */
+public interface SecuritySettingsMBean
+{
+ /**
+ * Gets the authorization strategy.
+ *
+ * @return Returns the authorizationStrategy.
+ */
+ String getAuthorizationStrategy();
+
+ /**
+ * @return crypt factory used to generate crypt objects
+ */
+ String getCryptFactory();
+
+ /**
+ * @return The listener
+ * @see IUnauthorizedComponentInstantiationListener
+ */
+ String getUnauthorizedComponentInstantiationListener();
+}
Added: incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/SessionSettings.java
URL: http://svn.apache.org/viewvc/incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/SessionSettings.java?view=auto&rev=464199
==============================================================================
--- incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/SessionSettings.java (added)
+++ incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/SessionSettings.java Sun Oct 15 07:15:41 2006
@@ -0,0 +1,76 @@
+/*
+ * ==============================================================================
+ * Licensed 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 wicket.jmx;
+
+/**
+ * Exposes Application related functionality for JMX.
+ *
+ * @author eelcohillenius
+ */
+public class SessionSettings implements SessionSettingsMBean
+{
+ private final wicket.Application application;
+
+ /**
+ * Create.
+ *
+ * @param application
+ */
+ public SessionSettings(wicket.Application application)
+ {
+ this.application = application;
+ }
+
+ /**
+ * @see wicket.jmx.SessionSettingsMBean#getMaxPageMaps()
+ */
+ public int getMaxPageMaps()
+ {
+ return application.getSessionSettings().getMaxPageMaps();
+ }
+
+ /**
+ * @see wicket.jmx.SessionSettingsMBean#getPageFactory()
+ */
+ public String getPageFactory()
+ {
+ return Stringz.className(application.getSessionSettings().getPageFactory());
+ }
+
+ /**
+ * @see wicket.jmx.SessionSettingsMBean#getPageMapEvictionStrategy()
+ */
+ public String getPageMapEvictionStrategy()
+ {
+ return Stringz.className(application.getSessionSettings().getPageMapEvictionStrategy());
+ }
+
+ /**
+ * @see wicket.jmx.SessionSettingsMBean#getSessionStore()
+ */
+ public String getSessionStore()
+ {
+ return Stringz.className(application.getSessionStore());
+ }
+
+ /**
+ * @see wicket.jmx.SessionSettingsMBean#setMaxPageMaps(int)
+ */
+ public void setMaxPageMaps(int maxPageMaps)
+ {
+ application.getSessionSettings().setMaxPageMaps(maxPageMaps);
+ }
+
+}
Added: incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/SessionSettingsMBean.java
URL: http://svn.apache.org/viewvc/incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/SessionSettingsMBean.java?view=auto&rev=464199
==============================================================================
--- incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/SessionSettingsMBean.java (added)
+++ incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/SessionSettingsMBean.java Sun Oct 15 07:15:41 2006
@@ -0,0 +1,60 @@
+/*
+ * ==============================================================================
+ * Licensed 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 wicket.jmx;
+
+
+/**
+ * Session settings.
+ *
+ * @author eelcohillenius
+ */
+public interface SessionSettingsMBean
+{
+ /**
+ * Gets maximum number of page maps allowed in this session
+ *
+ * @return Maximum number of page maps
+ */
+ int getMaxPageMaps();
+
+ /**
+ * Gets the factory to be used when creating pages
+ *
+ * @return The default page factory
+ */
+ String getPageFactory();
+
+ /**
+ * Gets the strategy for evicting pages from the page map.
+ *
+ * @return the strategy for evicting pages from the page map
+ */
+ String getPageMapEvictionStrategy();
+
+ /**
+ * Gets the session store implementation.
+ *
+ * @return the session store implementation
+ */
+ String getSessionStore();
+
+ /**
+ * Sets maximum number of page maps allowed in this session
+ *
+ * @param maxPageMaps
+ * Maximum number of page maps
+ */
+ void setMaxPageMaps(int maxPageMaps);
+}
Added: incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/Stringz.java
URL: http://svn.apache.org/viewvc/incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/Stringz.java?view=auto&rev=464199
==============================================================================
--- incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/Stringz.java (added)
+++ incubator/wicket/trunk/wicket/src/main/java/wicket/jmx/Stringz.java Sun Oct 15 07:15:41 2006
@@ -0,0 +1,8 @@
+package wicket.jmx;
+
+class Stringz
+{
+ static String className(Object o) {
+ return (o != null) ? o.getClass().getName() : null;
+ }
+}