Skip to content

Commit

Permalink
Merge branch 'release/1.33.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
jesse-gallagher committed Jan 19, 2024
2 parents 3f3fc48 + d8b9f77 commit c97e7b8
Show file tree
Hide file tree
Showing 43 changed files with 543 additions and 444 deletions.
2 changes: 1 addition & 1 deletion domino-jnx-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.hcl.domino</groupId>
<artifactId>domino-jnx</artifactId>
<version>1.32.0</version>
<version>1.33.0</version>
</parent>
<artifactId>domino-jnx-api</artifactId>
<name>HCL Domino API</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import com.hcl.domino.DominoClient;
import com.hcl.domino.DominoClientBuilder;
import com.hcl.domino.DominoProcess;
import com.hcl.domino.misc.JNXThread;
import com.hcl.domino.DominoProcess.DominoThreadContext;
import com.hcl.domino.mq.MessageQueue;

/**
Expand All @@ -29,7 +29,7 @@
* @author Jesse Gallagher
* @since 1.0.11
*/
public abstract class RunJavaAddin extends JNXThread {
public abstract class RunJavaAddin extends Thread {

private final String addinName;
private final String queueName;
Expand Down Expand Up @@ -63,29 +63,29 @@ public RunJavaAddin(final String addinName, final String queueName) {
}

@Override
protected final void doRun() {
public final void run() {
DominoProcess.get().initializeProcess(new String[0]);
try {
try (DominoThreadContext ctx = DominoProcess.get().initializeThread()) {
try (DominoClient client = DominoClientBuilder.newDominoClient().build()) {
try (ServerStatusLine line = client.getServerAdmin().createServerStatusLine(this.addinName)) {
line.setLine("Running");
try (MessageQueue queue = client.getMessageQueues().createAndOpen("MQ$" + this.queueName.toUpperCase(), 0)) { //$NON-NLS-1$
try (MessageQueue queue = client.getMessageQueues().open("MQ$" + this.queueName.toUpperCase(), true)) { //$NON-NLS-1$
this.runAddin(client, line, queue);
System.gc();
} catch (final Exception e) {
e.printStackTrace();
} finally {
System.gc();
}
}
}
} finally {
System.gc();
DominoProcess.get().terminateProcess();
}

}

protected abstract void runAddin(DominoClient client, ServerStatusLine statusLine, MessageQueue queue);

public void stopAddin() {

}

}
2 changes: 1 addition & 1 deletion domino-jnx-commons/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.hcl.domino</groupId>
<artifactId>domino-jnx</artifactId>
<version>1.32.0</version>
<version>1.33.0</version>
</parent>
<artifactId>domino-jnx-commons</artifactId>
<name>HCL Domino API Common Code</name>
Expand Down
2 changes: 1 addition & 1 deletion domino-jnx-console/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.hcl.domino</groupId>
<artifactId>domino-jnx</artifactId>
<version>1.32.0</version>
<version>1.33.0</version>
</parent>
<artifactId>domino-jnx-console</artifactId>
<name>HCL Domino API Server Controller Connector</name>
Expand Down
2 changes: 1 addition & 1 deletion domino-jnx-jna/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.hcl.domino</groupId>
<artifactId>domino-jnx</artifactId>
<version>1.32.0</version>
<version>1.33.0</version>
</parent>
<artifactId>domino-jnx-jna</artifactId>
<name>HCL Domino API, JNA Implementation</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -314,21 +314,20 @@ public <T> T getAdapter(Class<T> clazz) {

@Override
public String getIDUserName() {
Memory retUserNameMem = new Memory(NotesConstants.MAXUSERNAME + 1);
try(DisposableMemory retUserNameMem = new DisposableMemory(NotesConstants.MAXUSERNAME + 1)) {

short result = NotesCAPI.get().SECKFMGetUserName(retUserNameMem);
checkResult(result);

int userNameLength = 0;
for (int i = 0; i < retUserNameMem.size(); i++) {
userNameLength = i;
if (retUserNameMem.getByte(i) == 0) {
break;
checkResult(NotesCAPI.get().SECKFMGetUserName(retUserNameMem));

int userNameLength = 0;
for (int i = 0; i < retUserNameMem.size(); i++) {
userNameLength = i;
if (retUserNameMem.getByte(i) == 0) {
break;
}
}

return NotesStringUtils.fromLMBCS(retUserNameMem, userNameLength);
}

String userName = NotesStringUtils.fromLMBCS(retUserNameMem, userNameLength);
return userName;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,22 +203,21 @@ public String switchToId(Path idPath, String password, boolean dontSetEnvVar) {
}
Memory idPathMem = NotesStringUtils.toLMBCS(idPath.toString(), true);
Memory passwordMem = NotesStringUtils.toLMBCS(password, true);
Memory retUserNameMem = new Memory(NotesConstants.MAXUSERNAME+1);

short result = NotesCAPI.get().SECKFMSwitchToIDFile(idPathMem, passwordMem, retUserNameMem,
NotesConstants.MAXUSERNAME, dontSetEnvVar ? NotesConstants.fKFM_switchid_DontSetEnvVar : 0, null);
NotesErrorUtils.checkResult(result);

int userNameLength = 0;
for (int i=0; i<retUserNameMem.size(); i++) {
userNameLength = i;
if (retUserNameMem.getByte(i) == 0) {
break;
}
try(DisposableMemory retUserNameMem = new DisposableMemory(NotesConstants.MAXUSERNAME+1)) {
short result = NotesCAPI.get().SECKFMSwitchToIDFile(idPathMem, passwordMem, retUserNameMem,
NotesConstants.MAXUSERNAME, dontSetEnvVar ? NotesConstants.fKFM_switchid_DontSetEnvVar : 0, null);
NotesErrorUtils.checkResult(result);

int userNameLength = 0;
for (int i=0; i<retUserNameMem.size(); i++) {
userNameLength = i;
if (retUserNameMem.getByte(i) == 0) {
break;
}
}

return NotesStringUtils.fromLMBCS(retUserNameMem, userNameLength);
}

String userName = NotesStringUtils.fromLMBCS(retUserNameMem, userNameLength);
return userName;
}

private static boolean isWritePacemakerDebugMessages() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ public void logMessage(String messageText) {
String[] lines = messageText.split("\\r?\\n", -1); //$NON-NLS-1$
for (String line : lines) {
Memory lmbcs = NotesStringUtils.toLMBCS(line, true);
NotesCAPI.get().AddInLogMessageText(lmbcs, (short)0, new Object[0]);
NotesCAPI.get().AddInLogMessageText(lmbcs, (short)0);
}
}

Expand Down
Loading

0 comments on commit c97e7b8

Please sign in to comment.