Interface RemoteServer

  • All Superinterfaces:
    org.refcodes.mixin.BusyAccessor, org.refcodes.structure.Clearable, org.refcodes.component.Closable, org.refcodes.component.Closable.CloseAutomaton, org.refcodes.component.ClosedAccessor, org.refcodes.component.Component, org.refcodes.component.ConnectableComponent, org.refcodes.component.ConnectableComponent.ConnectableAutomaton, org.refcodes.component.ConnectionComponent<org.refcodes.io.DatagramTransceiver<java.io.Serializable>>, org.refcodes.component.ConnectionComponent.ConnectionAutomaton<org.refcodes.io.DatagramTransceiver<java.io.Serializable>>, org.refcodes.component.ConnectionOpenable<org.refcodes.io.DatagramTransceiver<java.io.Serializable>>, org.refcodes.component.ConnectionOpenable.ConnectionOpenAutomaton<org.refcodes.io.DatagramTransceiver<java.io.Serializable>>, org.refcodes.component.ConnectionStatusAccessor, org.refcodes.structure.Containable, org.refcodes.component.Destroyable, org.refcodes.component.OpenedAccessor, Remote
    All Known Implementing Classes:
    RemoteServerImpl


    public interface RemoteServer
    extends Remote
    Remote control providing subjects to be operated on by RemoteClient instances.
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface org.refcodes.mixin.BusyAccessor

        org.refcodes.mixin.BusyAccessor.BusyMutator, org.refcodes.mixin.BusyAccessor.BusyProperty
      • Nested classes/interfaces inherited from interface org.refcodes.component.Closable

        org.refcodes.component.Closable.CloseAutomaton, org.refcodes.component.Closable.CloseBuilder<B extends org.refcodes.component.Closable.CloseBuilder<B>>
      • Nested classes/interfaces inherited from interface org.refcodes.component.ClosedAccessor

        org.refcodes.component.ClosedAccessor.ClosedMutator, org.refcodes.component.ClosedAccessor.ClosedProperty
      • Nested classes/interfaces inherited from interface org.refcodes.component.ConnectableComponent

        org.refcodes.component.ConnectableComponent.ConnectableAutomaton
      • Nested classes/interfaces inherited from interface org.refcodes.component.ConnectionComponent

        org.refcodes.component.ConnectionComponent.ConnectionAutomaton<CON extends java.lang.Object>, org.refcodes.component.ConnectionComponent.ConnectionComponentBuilder<CON extends java.lang.Object,B extends org.refcodes.component.ConnectionComponent.ConnectionComponentBuilder<CON,B>>
      • Nested classes/interfaces inherited from interface org.refcodes.component.ConnectionOpenable

        org.refcodes.component.ConnectionOpenable.ConnectionOpenAutomaton<CON extends java.lang.Object>, org.refcodes.component.ConnectionOpenable.ConnectionOpenBuilder<CON extends java.lang.Object,B extends org.refcodes.component.ConnectionOpenable.ConnectionOpenBuilder<CON,B>>
      • Nested classes/interfaces inherited from interface org.refcodes.component.ConnectionStatusAccessor

        org.refcodes.component.ConnectionStatusAccessor.ConnectionStatusMutator, org.refcodes.component.ConnectionStatusAccessor.ConnectionStatusProperty
      • Nested classes/interfaces inherited from interface org.refcodes.component.Destroyable

        org.refcodes.component.Destroyable.DestroyAutomaton
      • Nested classes/interfaces inherited from interface org.refcodes.component.OpenedAccessor

        org.refcodes.component.OpenedAccessor.OpenedMutator, org.refcodes.component.OpenedAccessor.OpenedProperty
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      boolean hasSubject​(java.lang.Object aSubject)
      Returns true if the provided subject is contained inside this RemoteServer.
      boolean publishSubject​(java.lang.Object aSubject)
      Publishes an object to any RemoteClient connected to the RemoteServer.
      boolean signOffSubject​(java.lang.Object aSubject)
      Tries to sign off the (previously published) subject, this can be vetoed in case the subject is still in use by a RemoteClient.
      boolean signOffSubject​(java.lang.Object aSubject, int aTimeoutInMs)
      Signs off the (previously published) subject, this be vetoed even in case the subject is still in use by a RemoteClient, but the veto will only delay the sign off by the given timeout.
      java.util.Iterator<java.lang.Object> subjects​()
      Returns an (immutable) iterator containing all the proxy objects previously being published.
      • Methods inherited from interface org.refcodes.mixin.BusyAccessor

        isBusy
      • Methods inherited from interface org.refcodes.structure.Clearable

        clear
      • Methods inherited from interface org.refcodes.component.Closable

        close, closeIn, closeQuietly, closeUnchecked
      • Methods inherited from interface org.refcodes.component.Closable.CloseAutomaton

        isClosable
      • Methods inherited from interface org.refcodes.component.ClosedAccessor

        isClosed
      • Methods inherited from interface org.refcodes.component.ConnectionOpenable

        open, openUnchecked
      • Methods inherited from interface org.refcodes.component.ConnectionOpenable.ConnectionOpenAutomaton

        isOpenable
      • Methods inherited from interface org.refcodes.component.ConnectionStatusAccessor

        getConnectionStatus, isConnectionOpened
      • Methods inherited from interface org.refcodes.structure.Containable

        isEmpty, size
      • Methods inherited from interface org.refcodes.component.Destroyable

        destroy
      • Methods inherited from interface org.refcodes.component.OpenedAccessor

        isOpened
    • Method Detail

      • hasSubject

        boolean hasSubject​(java.lang.Object aSubject)
        Returns true if the provided subject is contained inside this RemoteServer.
        Parameters:
        aSubject - The subject to be tested if it is contained inside the RemoteServer.
        Returns:
        True if the given subject is contained inside the RemoteServer.
      • subjects

        java.util.Iterator<java.lang.Object> subjects​()
        Returns an (immutable) iterator containing all the proxy objects previously being published. Use the signOffSubject(Object) method in order to remove a published subject.
        Returns:
        An iterator containing the published proxy objects.
      • publishSubject

        boolean publishSubject​(java.lang.Object aSubject)
                        throws org.refcodes.component.OpenException
        Publishes an object to any RemoteClient connected to the RemoteServer.
        Parameters:
        aSubject - A subject being published for inter-process communication such as remote procedure calls or remote method invocations.
        Returns:
        True is returned if the subject could be published, else false is returned
        Throws:
        org.refcodes.component.OpenException - Thrown in case opening or accessing an open line (connection, junction, link) caused problems.
      • signOffSubject

        boolean signOffSubject​(java.lang.Object aSubject)
                        throws org.refcodes.exception.VetoException,
                               org.refcodes.component.OpenException
        Tries to sign off the (previously published) subject, this can be vetoed in case the subject is still in use by a RemoteClient.
        Parameters:
        aSubject - Description is currently not available!
        Returns:
        True if the removal of the subject has been successful. If the subject has not been found then false is returned. If a RemoteClient threw a VetoException then the sign-off is aborted.
        Throws:
        org.refcodes.exception.VetoException - the veto exception
        org.refcodes.component.OpenException - Thrown in case opening or accessing an open line (connection, junction, link) caused problems.
      • signOffSubject

        boolean signOffSubject​(java.lang.Object aSubject,
                               int aTimeoutInMs)
                        throws org.refcodes.component.OpenException
        Signs off the (previously published) subject, this be vetoed even in case the subject is still in use by a RemoteClient, but the veto will only delay the sign off by the given timeout.
        Parameters:
        aSubject - The subject to be signed off.
        aTimeoutInMs - The timeout to be granted in case the sign-off has been vetoed, nevertheless the subject will be signed off after the timeout elapsed.
        Returns:
        True if the removal of the subject has been successful. If the subject has not been found then false is returned. If a RemoteClient threw a VetoException then the sign-off is aborted.
        Throws:
        org.refcodes.component.OpenException - Thrown in case opening or accessing an open line (connection, junction, link) caused problems.