Skip to content

Commit

Permalink
Merge pull request #29 from kenta-shimizu/v6
Browse files Browse the repository at this point in the history
Add GemAccessor Interface
  • Loading branch information
kenta-shimizu authored Feb 11, 2024
2 parents 9ed5874 + 01555a3 commit 472bd42
Show file tree
Hide file tree
Showing 13 changed files with 364 additions and 479 deletions.
20 changes: 20 additions & 0 deletions src/main/java/com/shimizukenta/secs/GemAccessor.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package com.shimizukenta.secs;

import com.shimizukenta.secs.gem.Gem;

/**
* GEM Accessor.
*
* @author kenta-shimizu
*
*/
public interface GemAccessor extends SecsCommunicatorConfigValueGettable, SecsMessageSendable {

/**
* Returns GEM-interface.
*
* @return GEM-interface-instance
*/
public Gem gem();

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
package com.shimizukenta.secs;

import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;

/**
* SECS Communicate State Detectable.
*
* @author kenta-shimizu
*
*/
public interface SecsCommunicateStateDetectable {

/**
* Returns true if communicatable.
*
* <p>
* Communicatable is send and receive message.
* </p>
*
* @return true if communicatable
*/
public boolean isCommunicatable();

/**
* Wait until communicatable.
*
* <p>
* Blocking-method.<br />
* If Already communicatable, do nothing.<br />
* </p>
*
* @throws InterruptedException if interrupted
*/
public void waitUntilCommunicatable() throws InterruptedException;

/**
* Wait until communicatable.
*
* <p>
* Blocking-method.<br />
* If Already communicatable, do nothing.<br />
* </p>
*
* @param timeout the timeout value
* @param unit the timeout unit
* @throws InterruptedException if interrupted
* @throws TimeoutException if timeout
*/
public void waitUntilCommunicatable(long timeout, TimeUnit unit) throws InterruptedException, TimeoutException;

/**
* Wait until <strong>NOT</strong> communicatable.
*
* <p>
* Blocking-method.<br />
* If Already not communicatable, do nothing.<br />
* </p>
*
* @throws InterruptedException if interrupted
*/
public void waitUntilNotCommunicatable() throws InterruptedException;

/**
* Wait until <strong>NOT</strong> communicatable.
*
* <p>
* Blocking-method.<br />
* If Already not communicatable, do nothing.<br />
* </p>
*
* @param timeout the timeout value
* @param unit the timeout unit
* @throws InterruptedException if interrupted
* @throws TimeoutException if timeout
*/
public void waitUntilNotCommunicatable(long timeout, TimeUnit unit) throws InterruptedException, TimeoutException;




/* Secs-Communicatable-State-Changed-Listener */

/**
* Add Listener to get communicate-state-changed.
*
* <p>
* Blocking-Listener.<br />
* Pass through quickly.<br />
* </p>
*
* @param listener Not accept {@code null}
* @return {@code true} if add success
*/
public boolean addSecsCommunicatableStateChangeListener(SecsCommunicatableStateChangeListener listener);

/**
* Remove Listener.
*
* @param listener Not accept {@code null}
* @return {@code true} if remove success
*/
public boolean removeSecsCommunicatableStateChangeListener(SecsCommunicatableStateChangeListener listener);

/**
* Add Listener to get communicate-state-changed.
*
* <p>
* Blocking-Listener.<br />
* Pass through quickly.<br />
* </p>
*
* @param listener Not accept {@code null}
* @return {@code true} if add success
*/
public boolean addSecsCommunicatableStateChangeBiListener(SecsCommunicatableStateChangeBiListener listener);

/**
* Remove Listener.
*
* @param listener Not accept {@code null}
* @return {@code true} if remove success
*/
public boolean removeSecsCommunicatableStateChangeBiListener(SecsCommunicatableStateChangeBiListener listener);

}
Loading

0 comments on commit 472bd42

Please sign in to comment.