summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeif Åstrand <leif@vaadin.com>2012-09-25 14:40:18 +0300
committerLeif Åstrand <leif@vaadin.com>2012-09-25 14:40:18 +0300
commit079fee4ac6b8f8633b195f0bc52c29722a232ce0 (patch)
treec0c1fd7195f519a944b2fb1a524e4138df95fa5e
parent44e15e19d307a676a03b31d69349138f79fd10c8 (diff)
downloadvaadin-framework-079fee4ac6b8f8633b195f0bc52c29722a232ce0.tar.gz
vaadin-framework-079fee4ac6b8f8633b195f0bc52c29722a232ce0.zip
Shorten addVaadinSessionInitializationListener name pattern (#9750)
-rw-r--r--server/src/com/vaadin/server/AddonContext.java6
-rw-r--r--server/src/com/vaadin/server/LegacyVaadinPortlet.java8
-rw-r--r--server/src/com/vaadin/server/LegacyVaadinServlet.java8
-rw-r--r--server/src/com/vaadin/server/SessionDestroyEvent.java (renamed from server/src/com/vaadin/server/VaadinSessionDestroyEvent.java)6
-rw-r--r--server/src/com/vaadin/server/SessionDestroyListener.java (renamed from server/src/com/vaadin/server/VaadinSessionDestroyListener.java)4
-rw-r--r--server/src/com/vaadin/server/SessionInitEvent.java (renamed from server/src/com/vaadin/server/VaadinSessionInitializeEvent.java)8
-rw-r--r--server/src/com/vaadin/server/SessionInitListener.java (renamed from server/src/com/vaadin/server/VaadinSessionInitializationListener.java)6
-rw-r--r--server/src/com/vaadin/server/VaadinService.java45
-rw-r--r--uitest/src/com/vaadin/launcher/ApplicationRunnerServlet.java12
9 files changed, 49 insertions, 54 deletions
diff --git a/server/src/com/vaadin/server/AddonContext.java b/server/src/com/vaadin/server/AddonContext.java
index 513d56150b..0e147e4fcd 100644
--- a/server/src/com/vaadin/server/AddonContext.java
+++ b/server/src/com/vaadin/server/AddonContext.java
@@ -55,10 +55,10 @@ public class AddonContext implements Serializable {
public AddonContext(VaadinService vaadinService) {
this.vaadinService = vaadinService;
vaadinService
- .addVaadinSessionInitializationListener(new VaadinSessionInitializationListener() {
+ .addSessionInitListener(new SessionInitListener() {
@Override
- public void vaadinSessionInitialized(
- VaadinSessionInitializeEvent event)
+ public void sessionInit(
+ SessionInitEvent event)
throws ServiceException {
for (BootstrapListener l : bootstrapListeners) {
event.getSession().addBootstrapListener(l);
diff --git a/server/src/com/vaadin/server/LegacyVaadinPortlet.java b/server/src/com/vaadin/server/LegacyVaadinPortlet.java
index a91a82076e..067cd6266f 100644
--- a/server/src/com/vaadin/server/LegacyVaadinPortlet.java
+++ b/server/src/com/vaadin/server/LegacyVaadinPortlet.java
@@ -48,11 +48,11 @@ public class LegacyVaadinPortlet extends VaadinPortlet {
public void init(PortletConfig portletConfig) throws PortletException {
super.init(portletConfig);
- getService().addVaadinSessionInitializationListener(
- new VaadinSessionInitializationListener() {
+ getService().addSessionInitListener(
+ new SessionInitListener() {
@Override
- public void vaadinSessionInitialized(
- VaadinSessionInitializeEvent event)
+ public void sessionInit(
+ SessionInitEvent event)
throws ServiceException {
try {
onVaadinSessionStarted(VaadinPortletRequest
diff --git a/server/src/com/vaadin/server/LegacyVaadinServlet.java b/server/src/com/vaadin/server/LegacyVaadinServlet.java
index 1209ca8419..097ab02a6a 100644
--- a/server/src/com/vaadin/server/LegacyVaadinServlet.java
+++ b/server/src/com/vaadin/server/LegacyVaadinServlet.java
@@ -49,11 +49,11 @@ public class LegacyVaadinServlet extends VaadinServlet {
public void init(ServletConfig servletConfig) throws ServletException {
super.init(servletConfig);
- getService().addVaadinSessionInitializationListener(
- new VaadinSessionInitializationListener() {
+ getService().addSessionInitListener(
+ new SessionInitListener() {
@Override
- public void vaadinSessionInitialized(
- VaadinSessionInitializeEvent event)
+ public void sessionInit(
+ SessionInitEvent event)
throws ServiceException {
try {
onVaadinSessionStarted(event.getRequest(),
diff --git a/server/src/com/vaadin/server/VaadinSessionDestroyEvent.java b/server/src/com/vaadin/server/SessionDestroyEvent.java
index 9dc877863f..f35dbc8154 100644
--- a/server/src/com/vaadin/server/VaadinSessionDestroyEvent.java
+++ b/server/src/com/vaadin/server/SessionDestroyEvent.java
@@ -21,12 +21,12 @@ import java.util.EventObject;
/**
* Event fired when a Vaadin session is no longer in use.
*
- * @see VaadinSessionDestroyListener#vaadinSessionDestroyed(VaadinSessionDestroyEvent)
+ * @see SessionDestroyListener#sessionDestroy(VaadinSessionDestroyEvent)
*
* @author Vaadin Ltd
* @since 7.0.0
*/
-public class VaadinSessionDestroyEvent extends EventObject {
+public class SessionDestroyEvent extends EventObject {
private final VaadinSession session;
@@ -38,7 +38,7 @@ public class VaadinSessionDestroyEvent extends EventObject {
* @param session
* the Vaadin session that is no longer used
*/
- public VaadinSessionDestroyEvent(VaadinService service,
+ public SessionDestroyEvent(VaadinService service,
VaadinSession session) {
super(service);
this.session = session;
diff --git a/server/src/com/vaadin/server/VaadinSessionDestroyListener.java b/server/src/com/vaadin/server/SessionDestroyListener.java
index 3f516c1eda..035b03c627 100644
--- a/server/src/com/vaadin/server/VaadinSessionDestroyListener.java
+++ b/server/src/com/vaadin/server/SessionDestroyListener.java
@@ -24,12 +24,12 @@ package com.vaadin.server;
* @author Vaadin Ltd
* @since 7.0.0
*/
-public interface VaadinSessionDestroyListener {
+public interface SessionDestroyListener {
/**
* Called when a Vaadin session is no longer used.
*
* @param event
* the event with details about the destroyed session
*/
- public void vaadinSessionDestroyed(VaadinSessionDestroyEvent event);
+ public void sessionDestroy(SessionDestroyEvent event);
}
diff --git a/server/src/com/vaadin/server/VaadinSessionInitializeEvent.java b/server/src/com/vaadin/server/SessionInitEvent.java
index a05b40a7dc..34272d06ad 100644
--- a/server/src/com/vaadin/server/VaadinSessionInitializeEvent.java
+++ b/server/src/com/vaadin/server/SessionInitEvent.java
@@ -27,12 +27,12 @@ import java.util.EventObject;
* only when the first request for that session is handled by a specific
* service.
*
- * @see VaadinSessionInitializationListener#vaadinSessionInitialized(VaadinSessionInitializeEvent)
+ * @see SessionInitListener#sessionInit(SessionInitEvent)
*
* @author Vaadin Ltd
* @since 7.0.0
*/
-public class VaadinSessionInitializeEvent extends EventObject {
+public class SessionInitEvent extends EventObject {
private final VaadinSession session;
private final VaadinRequest request;
@@ -47,8 +47,8 @@ public class VaadinSessionInitializeEvent extends EventObject {
* @param request
* the request that triggered the initialization
*/
- public VaadinSessionInitializeEvent(VaadinService service,
- VaadinSession session, VaadinRequest request) {
+ public SessionInitEvent(VaadinService service, VaadinSession session,
+ VaadinRequest request) {
super(service);
this.session = session;
this.request = request;
diff --git a/server/src/com/vaadin/server/VaadinSessionInitializationListener.java b/server/src/com/vaadin/server/SessionInitListener.java
index c4722b9a86..b34cf9b095 100644
--- a/server/src/com/vaadin/server/VaadinSessionInitializationListener.java
+++ b/server/src/com/vaadin/server/SessionInitListener.java
@@ -27,12 +27,12 @@ import java.io.Serializable;
* but only when the first request for that session is handled by a specific
* service.
*
- * @see VaadinService#addVaadinSessionInitializationListener(VaadinSessionInitializationListener)
+ * @see VaadinService#addSessionInitListener(SessionInitListener)
*
* @author Vaadin Ltd
* @since 7.0.0
*/
-public interface VaadinSessionInitializationListener extends Serializable {
+public interface SessionInitListener extends Serializable {
/**
* Invoked when a new Vaadin session is initialized for that service.
* <p>
@@ -46,6 +46,6 @@ public interface VaadinSessionInitializationListener extends Serializable {
* @throws ServiceException
* a problem occurs when processing the event
*/
- public void vaadinSessionInitialized(VaadinSessionInitializeEvent event)
+ public void sessionInit(SessionInitEvent event)
throws ServiceException;
}
diff --git a/server/src/com/vaadin/server/VaadinService.java b/server/src/com/vaadin/server/VaadinService.java
index 2c0331c65e..fc55a473a0 100644
--- a/server/src/com/vaadin/server/VaadinService.java
+++ b/server/src/com/vaadin/server/VaadinService.java
@@ -117,12 +117,11 @@ public abstract class VaadinService implements Serializable {
}
private static final Method SESSION_INIT_METHOD = ReflectTools.findMethod(
- VaadinSessionInitializationListener.class,
- "vaadinSessionInitialized", VaadinSessionInitializeEvent.class);
+ SessionInitListener.class, "sessionInit", SessionInitEvent.class);
private static final Method SESSION_DESTROY_METHOD = ReflectTools
- .findMethod(VaadinSessionDestroyListener.class,
- "vaadinSessionDestroyed", VaadinSessionDestroyEvent.class);
+ .findMethod(SessionDestroyListener.class, "sessionDestroy",
+ SessionDestroyEvent.class);
/**
* @deprecated Only supported for {@link LegacyApplication}.
@@ -299,44 +298,41 @@ public abstract class VaadinService implements Serializable {
* created but only when the first request for that session is handled by
* this service.
*
- * @see #removeVaadinSessionInitializationListener(VaadinSessionInitializationListener)
- * @see VaadinSessionInitializationListener
+ * @see #removeSessionInitListener(SessionInitListener)
+ * @see SessionInitListener
*
* @param listener
* the vaadin session initialization listener
*/
- public void addVaadinSessionInitializationListener(
- VaadinSessionInitializationListener listener) {
- eventRouter.addListener(VaadinSessionInitializeEvent.class, listener,
+ public void addSessionInitListener(SessionInitListener listener) {
+ eventRouter.addListener(SessionInitEvent.class, listener,
SESSION_INIT_METHOD);
}
/**
* Removes a Vaadin session initialization listener from this service.
*
- * @see #addVaadinSessionInitializationListener(VaadinSessionInitializationListener)
+ * @see #addSessionInitListener(SessionInitListener)
*
* @param listener
* the Vaadin session initialization listener to remove.
*/
- public void removeVaadinSessionInitializationListener(
- VaadinSessionInitializationListener listener) {
- eventRouter.removeListener(VaadinSessionInitializeEvent.class,
- listener, SESSION_INIT_METHOD);
+ public void removeSessionInitListener(SessionInitListener listener) {
+ eventRouter.removeListener(SessionInitEvent.class, listener,
+ SESSION_INIT_METHOD);
}
/**
* Adds a listener that gets notified when a Vaadin session that has been
* initialized for this service is destroyed.
*
- * @see #addVaadinSessionInitializationListener(VaadinSessionInitializationListener)
+ * @see #addSessionInitListener(SessionInitListener)
*
* @param listener
* the vaadin session destroy listener
*/
- public void addVaadinSessionDestroyListener(
- VaadinSessionDestroyListener listener) {
- eventRouter.addListener(VaadinSessionDestroyEvent.class, listener,
+ public void addVaadinSessionDestroyListener(SessionDestroyListener listener) {
+ eventRouter.addListener(SessionDestroyEvent.class, listener,
SESSION_DESTROY_METHOD);
}
@@ -345,21 +341,20 @@ public abstract class VaadinService implements Serializable {
vaadinSession.cleanupUI(ui);
}
- eventRouter
- .fireEvent(new VaadinSessionDestroyEvent(this, vaadinSession));
+ eventRouter.fireEvent(new SessionDestroyEvent(this, vaadinSession));
}
/**
* Removes a Vaadin session destroy listener from this service.
*
- * @see #addVaadinSessionDestroyListener(VaadinSessionDestroyListener)
+ * @see #addVaadinSessionDestroyListener(SessionDestroyListener)
*
* @param listener
* the vaadin session destroy listener
*/
public void removeVaadinSessionDestroyListener(
- VaadinSessionDestroyListener listener) {
- eventRouter.removeListener(VaadinSessionDestroyEvent.class, listener,
+ SessionDestroyListener listener) {
+ eventRouter.removeListener(SessionDestroyEvent.class, listener,
SESSION_DESTROY_METHOD);
}
@@ -508,8 +503,7 @@ public abstract class VaadinService implements Serializable {
private void onVaadinSessionStarted(VaadinRequest request,
VaadinSession session) throws ServiceException {
- eventRouter.fireEvent(new VaadinSessionInitializeEvent(this, session,
- request));
+ eventRouter.fireEvent(new SessionInitEvent(this, session, request));
ServletPortletHelper.checkUiProviders(session, this);
}
@@ -719,6 +713,7 @@ public abstract class VaadinService implements Serializable {
* typically checks the @{@link PreserveOnRefresh} annotation but UI
* providers and ultimately VaadinService implementations may choose to
* override the defaults.
+ *
* @param provider
* the UI provider responsible for the UI
* @param event
diff --git a/uitest/src/com/vaadin/launcher/ApplicationRunnerServlet.java b/uitest/src/com/vaadin/launcher/ApplicationRunnerServlet.java
index 269080a59c..1883910b7b 100644
--- a/uitest/src/com/vaadin/launcher/ApplicationRunnerServlet.java
+++ b/uitest/src/com/vaadin/launcher/ApplicationRunnerServlet.java
@@ -39,8 +39,8 @@ import com.vaadin.server.VaadinRequest;
import com.vaadin.server.VaadinServletRequest;
import com.vaadin.server.VaadinServletService;
import com.vaadin.server.VaadinSession;
-import com.vaadin.server.VaadinSessionInitializationListener;
-import com.vaadin.server.VaadinSessionInitializeEvent;
+import com.vaadin.server.SessionInitListener;
+import com.vaadin.server.SessionInitEvent;
import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.UI;
@@ -76,11 +76,11 @@ public class ApplicationRunnerServlet extends LegacyVaadinServlet {
@Override
protected void servletInitialized() {
super.servletInitialized();
- getService().addVaadinSessionInitializationListener(
- new VaadinSessionInitializationListener() {
+ getService().addSessionInitListener(
+ new SessionInitListener() {
@Override
- public void vaadinSessionInitialized(
- VaadinSessionInitializeEvent event)
+ public void sessionInit(
+ SessionInitEvent event)
throws ServiceException {
onVaadinSessionStarted(event.getRequest(),
event.getSession());