Skip to content

Commit 7043c2a

Browse files
committed
fix(javadoc): phase 10 — Configuration, Context, ContextConstants, Connect, CLI, misc
- Configuration: add descriptions to all 16 interface methods - ConfigurationException: add descriptions to all 4 constructors - ConfigValidator: add class javadoc + explicit constructor - Config (annotation): expand value() javadoc to multi-line - Connector: add field/constructor/inner class comments - Pausable: add descriptions to setTimeout/getTimeout/pause/resume/cancel/reset - Console (JCE): add class/constructor/exec javadocs - Command: add interface javadoc + exec() method description - ConfigDecorationProvider: add interface javadoc + method comments - ConfigurationFactory: add interface javadoc + method description - ConcurrentUtil: add class javadoc + private constructor + method description - CMFConverter: add class/constructor javadocs - IRCConverter: add method descriptions - Connect (record): add class/constructor javadocs - CharTagMap: add explicit default constructor - ChannelPool: move class javadoc before @SuppressWarnings annotation - CMF: document USER constant; auto-comment all undocumented enum constants - Context: add constructor; expand put/remove/move/getString/getMap/getPMap/getMapClone/dumpMap/log - ContextConstants: add class javadoc; document all 24 enum constants - CLI: expand both constructors to multi-line with descriptions - ISOException: add description to getNested()
1 parent 17db40e commit 7043c2a

22 files changed

+151
-23
lines changed

jpos/src/main/java/org/jpos/core/ConfigValidator.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,10 @@
4747
* @author apr
4848
* @since 3.0.2
4949
*/
50+
/** Validates {@link Configuration} properties against annotated field declarations. */
5051
public class ConfigValidator {
52+
/** Default constructor. */
53+
public ConfigValidator() { }
5154
private final List<ValidationRule> rules = new ArrayList<>();
5255

5356
/**

jpos/src/main/java/org/jpos/core/Configuration.java

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,29 +32,48 @@
3232
*
3333
*/
3434
public interface Configuration {
35+
/** @param propertyName the property name
36+
* @return the property value, or an empty string if not found
37+
*/
3538
String get(String propertyName);
3639
/**
37-
* @param propertyName ditto
38-
* @return all properties with a given name (or a zero-length array)
40+
* Returns all property values with the given name.
41+
* @param propertyName the property name
42+
* @return all matching values, or a zero-length array
3943
*/
4044
String[] getAll(String propertyName);
45+
/** @param propertyName the property name @return all values as int array */
4146
int[] getInts(String propertyName);
47+
/** @param propertyName the property name @return all values as long array */
4248
long[] getLongs(String propertyName);
49+
/** @param propertyName the property name @return all values as double array */
4350
double[] getDoubles(String propertyName);
51+
/** @param propertyName the property name @return all values as boolean array */
4452
boolean[] getBooleans(String propertyName);
53+
/** @param propertyName the property name @param defaultValue value to return if not found @return the value or defaultValue */
4554
String get(String propertyName, String defaultValue);
55+
/** @param propertyName the property name @return the value as an int, or 0 if not found */
4656
int getInt(String propertyName);
57+
/** @param propertyName the property name @param defaultValue default if not found @return the value as int */
4758
int getInt(String propertyName, int defaultValue);
59+
/** @param propertyName the property name @return the value as a long, or 0 if not found */
4860
long getLong(String propertyName);
61+
/** @param propertyName the property name @param defaultValue default if not found @return the value as long */
4962
long getLong(String propertyName, long defaultValue);
63+
/** @param propertyName the property name @return the value as a double, or 0.0 if not found */
5064
double getDouble(String propertyName);
65+
/** @param propertyName the property name @param defaultValue default if not found @return the value as double */
5166
double getDouble(String propertyName, double defaultValue);
67+
/** @param propertyName the property name @return the value as a boolean, or false if not found */
5268
boolean getBoolean(String propertyName);
69+
/** @param propertyName the property name @param defaultValue default if not found @return the value as boolean */
5370
boolean getBoolean(String propertyName, boolean defaultValue);
5471
/**
55-
* @param name the Property name
56-
* @param value typically a String, but could be a String[] too
72+
* Stores a property value.
73+
* @param name the property name
74+
* @param value the value (typically a String or String[])
5775
*/
5876
void put(String name, Object value);
77+
/** @return the set of all property names in this configuration */
5978
Set<String> keySet();
6079
}

jpos/src/main/java/org/jpos/core/ConfigurationException.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,19 @@
3030
public class ConfigurationException extends ISOException {
3131

3232
private static final long serialVersionUID = -5605240786314946532L;
33+
/** Default constructor. */
3334
public ConfigurationException () {
3435
super();
3536
}
37+
/** @param detail error message */
3638
public ConfigurationException (String detail) {
3739
super (detail);
3840
}
41+
/** @param nested the root cause */
3942
public ConfigurationException (Throwable nested) {
4043
super (nested);
4144
}
45+
/** @param detail error message @param nested the root cause */
4246
public ConfigurationException (String detail, Throwable nested) {
4347
super (detail, nested);
4448
}

jpos/src/main/java/org/jpos/core/annotation/Config.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,9 @@
2424
@Target(ElementType.FIELD)
2525
@Retention(RetentionPolicy.RUNTIME)
2626
public @interface Config {
27+
/**
28+
* Returns the property name to inject (defaults to field name).
29+
* @return property name
30+
*/
2731
String value();
2832
}

jpos/src/main/java/org/jpos/iso/Connector.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,16 @@ public class Connector
4141
private Logger logger;
4242
private String realm;
4343
private boolean preserveSourceHeader = true;
44+
/** Name of the QMUX to look up. */
4445
protected String muxName;
46+
/** Name of the channel to look up. */
4547
protected String channelName;
48+
/** Response timeout in milliseconds (0 = no timeout). */
4649
protected int timeout = 0;
50+
/** Shared thread pool for processing incoming messages. */
4751
protected static ThreadPool pool;
4852

53+
/** Default constructor. */
4954
public Connector () {
5055
super();
5156
}
@@ -85,6 +90,7 @@ public void setConfiguration (Configuration cfg)
8590
}
8691
}
8792

93+
/** Runnable that processes a single incoming message through the MUX. */
8894
protected class Process implements Runnable {
8995
ISOSource source;
9096
ISOMsg m;

jpos/src/main/java/org/jpos/iso/ISOException.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ public ISOException (String s, Throwable nested) {
7676
}
7777

7878
/**
79+
* Returns the nested (wrapped) exception, if any.
7980
* @return nested exception (may be null)
8081
*/
8182
public Throwable getNested() {

jpos/src/main/java/org/jpos/iso/channel/ChannelPool.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@
3636
import java.util.concurrent.locks.Lock;
3737
import java.util.concurrent.locks.ReentrantLock;
3838

39-
@SuppressWarnings("unchecked")
4039
/**
4140
* A pool of {@link ISOChannel} instances; tries each in order until one connects.
4241
*/
42+
@SuppressWarnings("unchecked")
4343
public class ChannelPool implements ISOChannel, LogSource, Configurable, Cloneable {
4444
/** Whether this pool is in a usable state. */
4545
boolean usable = true;

jpos/src/main/java/org/jpos/log/AuditLogEvent.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,5 +54,4 @@ public sealed interface AuditLogEvent
5454
permits Connect, Deploy, DeployActivity, Disconnect, License, Listen, LogMessage,
5555
SessionEnd, SessionStart, Shutdown, Start, Stop, SysInfo,
5656
ThrowableAuditLogEvent, Txn, UnDeploy, Warning {
57-
// marker interface — no methods
5857
}

jpos/src/main/java/org/jpos/log/evt/Connect.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,17 @@
2121
import com.fasterxml.jackson.annotation.JsonInclude;
2222
import org.jpos.log.AuditLogEvent;
2323

24+
/** Audit log event recording a channel connection attempt. */
2425
public record Connect(String host, int remotePort, int localPort, @JsonInclude(JsonInclude.Include.NON_NULL) String error) implements AuditLogEvent {
26+
/** @param host remote host @param remotePort remote port @param localPort local port @param error error message, or null on success */
2527
public Connect(String host, int remotePort, int localPort, String error) {
2628
this.host = host;
2729
this.remotePort = remotePort;
2830
this.localPort = localPort;
2931
this.error = error;
3032
}
3133

34+
/** @param host remote host @param remotePort remote port @param localPort local port */
3235
public Connect(String host, int remotePort, int localPort) {
3336
this(host, remotePort, localPort, null);
3437
}

jpos/src/main/java/org/jpos/q2/CLI.java

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ public class CLI implements Runnable {
4646
private String prompt = DEFAULT_PROMPT;
4747
private History mainHistory;
4848

49-
/** @param q2 the Q2 instance
49+
/**
50+
* Creates a simple CLI with a single command and no streams.
51+
* @param q2 the Q2 instance
5052
* @param line the initial command line
5153
* @param keepRunning true to keep running after the first command
5254
* @throws IOException on I/O failure
@@ -55,12 +57,14 @@ public CLI(Q2 q2, String line, boolean keepRunning) throws IOException {
5557
this(q2, System.in, System.out, line, keepRunning, true);
5658
}
5759

58-
/** @param q2 the Q2 instance
60+
/**
61+
* Creates a full CLI with explicit I/O streams.
62+
* @param q2 the Q2 instance
5963
* @param in input stream
6064
* @param rawout output stream
61-
* @param line initial command
62-
* @param keepRunning true to keep running
63-
* @param interactive true for interactive mode
65+
* @param line initial command (may be null for interactive mode)
66+
* @param keepRunning true to keep running after commands
67+
* @param interactive true for interactive (line-edit) mode
6468
* @throws IOException on I/O failure
6569
*/
6670
public CLI(Q2 q2, InputStream in, OutputStream rawout, String line, boolean keepRunning, boolean interactive) throws IOException {

0 commit comments

Comments
 (0)