You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ApplicationStartedEvent.java 1.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /*
  2. * Copyright 2011 Vaadin Ltd.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License"); you may not
  5. * use this file except in compliance with the License. You may obtain a copy of
  6. * the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  12. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  13. * License for the specific language governing permissions and limitations under
  14. * the License.
  15. */
  16. package com.vaadin.server;
  17. import java.util.EventObject;
  18. import com.vaadin.Application;
  19. /**
  20. * Event used by
  21. * {@link ApplicationStartedListener#applicationStarted(ApplicationStartedEvent)}
  22. * .
  23. *
  24. * @author Vaadin Ltd
  25. * @since 7.0.0
  26. */
  27. public class ApplicationStartedEvent extends EventObject {
  28. private final Application application;
  29. /**
  30. * Creates a new event.
  31. *
  32. * @param context
  33. * the add-on context that will fire the event
  34. * @param application
  35. * the application that has been started
  36. */
  37. public ApplicationStartedEvent(AddonContext context, Application application) {
  38. super(context);
  39. this.application = application;
  40. }
  41. /**
  42. * Gets the add-on context from which this event originated.
  43. *
  44. * @return the add-on context that fired the
  45. */
  46. public AddonContext getContext() {
  47. return (AddonContext) getSource();
  48. }
  49. /**
  50. * Gets the newly started Application.
  51. *
  52. * @return the newly created application
  53. */
  54. public Application getApplication() {
  55. return application;
  56. }
  57. }