Interface RemoteServer

  • All Superinterfaces:
    org.refcodes.mixin.BusyAccessor, org.refcodes.mixin.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<Serializable>>, org.refcodes.component.ConnectionComponent.ConnectionAutomaton<org.refcodes.io.DatagramTransceiver<Serializable>>, org.refcodes.component.ConnectionOpenable<org.refcodes.io.DatagramTransceiver<Serializable>>, org.refcodes.component.ConnectionOpenable.ConnectionOpenAutomaton<org.refcodes.io.DatagramTransceiver<Serializable>>, org.refcodes.component.ConnectionStatusAccessor, org.refcodes.struct.Containable, org.refcodes.component.Destroyable, org.refcodes.mixin.EmptyAccessor, 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 Object>, org.refcodes.component.ConnectionComponent.ConnectionComponentBuilder<CON extends 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 Object>, org.refcodes.component.ConnectionOpenable.ConnectionOpenBuilder<CON extends 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.mixin.EmptyAccessor

        org.refcodes.mixin.EmptyAccessor.EmptyMutator, org.refcodes.mixin.EmptyAccessor.EmptyProperty
      • 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​(Object aSubject)
      Returns true if the provided subject is contained inside this RemoteServer.
      boolean publishSubject​(Object aSubject)
      Publishes an object to any RemoteClient connected to the RemoteServer.
      boolean signOffSubject​(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​(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.
      Iterator<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.mixin.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, isOpened
      • Methods inherited from interface org.refcodes.struct.Containable

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

        destroy
      • Methods inherited from interface org.refcodes.mixin.EmptyAccessor

        isEmpty
    • Method Detail

      • hasSubject

        boolean hasSubject​(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

        Iterator<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​(Object aSubject)
                        throws IOException
        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:
        IOException - Thrown in case opening or accessing an open line (connection, junction, link) caused problems.
      • signOffSubject

        boolean signOffSubject​(Object aSubject)
                        throws org.refcodes.exception.VetoException,
                               IOException
        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
        IOException - Thrown in case opening or accessing an open line (connection, junction, link) caused problems.
      • signOffSubject

        boolean signOffSubject​(Object aSubject,
                               int aTimeoutInMs)
                        throws IOException
        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:
        IOException - Thrown in case opening or accessing an open line (connection, junction, link) caused problems.