Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

ServerConnector.java 2.9KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. /*
  2. @VaadinApache2LicenseForJavaFiles@
  3. */
  4. package com.vaadin.terminal.gwt.client;
  5. import java.util.Collection;
  6. import com.vaadin.terminal.gwt.client.communication.ClientRpc;
  7. import com.vaadin.terminal.gwt.client.communication.SharedState;
  8. /**
  9. * Interface implemented by all client side classes that can be communicate with
  10. * the server. Classes implementing this interface are initialized by the
  11. * framework when needed and have the ability to communicate with the server.
  12. *
  13. * @author Vaadin Ltd
  14. * @version @VERSION@
  15. * @since 7.0.0
  16. */
  17. public interface ServerConnector {
  18. /**
  19. * TODO
  20. *
  21. * @param uidl
  22. * @param client
  23. */
  24. public void updateFromUIDL(UIDL uidl, ApplicationConnection client);
  25. /**
  26. * Gets the current shared state of the connector.
  27. *
  28. * @return state
  29. */
  30. public SharedState getState();
  31. /**
  32. * Sets a new state for the connector.
  33. *
  34. * @param state
  35. * The new state
  36. * @deprecated This should be removed. Framework should update what is
  37. * returned by getState() instead of setting a new state object.
  38. */
  39. @Deprecated
  40. public void setState(SharedState state);
  41. /**
  42. * Returns the id for this connector. This must always be what has been set
  43. * in {@link #doInit(String, ApplicationConnection)} and must never change.
  44. *
  45. * @return The id for the connector.
  46. */
  47. public String getId();
  48. /**
  49. * Gets ApplicationConnection instance that created this connector.
  50. *
  51. * @return The ApplicationConnection as set by
  52. * {@link #doInit(String, ApplicationConnection)}
  53. */
  54. public ApplicationConnection getConnection();
  55. /**
  56. * Tests whether the connector is enabled or not. Disabled connectors will
  57. * ignore all attempts at communications. Received messages will be
  58. * discarded. This method must check that the connector is enabled in
  59. * context, that is if it's parent is disabled, this method must return
  60. * false.
  61. *
  62. * @return true if the connector is enabled, false otherwise
  63. */
  64. public boolean isEnabled();
  65. /**
  66. *
  67. * Called once by the framework to initialize the connector.
  68. * <p>
  69. * Note that the shared state is not yet available at this point nor any
  70. * hierarchy information.
  71. */
  72. public void doInit(String connectorId, ApplicationConnection connection);
  73. /**
  74. * For internal use by the framework: returns the registered RPC
  75. * implementations for an RPC interface identifier.
  76. *
  77. * TODO interface identifier type or format may change
  78. *
  79. * @param rpcInterfaceId
  80. * RPC interface identifier: fully qualified interface type name
  81. * @return RPC interface implementations registered for an RPC interface,
  82. * not null
  83. */
  84. public <T extends ClientRpc> Collection<T> getRpcImplementations(
  85. String rpcInterfaceId);
  86. }