EMC Documentums Java Method Server
Kamel BELGACEM S.C. Euroscript-Certitude S.R.L.
January 2011
Java Method Server - Summary
Method Servers
Java Methods
Anatomy
Skeleton
Deployment
Tracing
Running JM Server
Checking JM Server
Known Issues
Java Method Server Method Servers
Method Server ?
A way for server-side scripting in Documentum
Hosts and executes server-side methods
Available Method Servers
Docbasic Method Server
Java Method Server
Java Method Server Java Method Server
Java Methods in Content Server
Run as separate processes
Hosted by Apache TomCAT (customized)
Called by
Jobs
Operating System (system exec)
Custom client application (API exec, HTTP call)
Java Methods vs Java Applications
Multiple instances of a JM, without spawning multiple JVM processes
Saves memory and resources => improves performance
JM Server is a separate process, could be maintained without recycling
the Content Server
Java Method Server - Anatomy
Anatomy
Implements IDmMethod interface
Implements the execute() method
Creates a new session
Throws an Exception instead of exit()
Releases the session once finished
Java Method Server - Skeleton
Skeleton
import
import
import
import
import
java.util.*;
java.io.OutputStream;
com.documentum.mthdservlet.IDmMethod;
com.documentum.fc.client.*;
com.documentum.fc.common.*;
public class MyServerMethod implements IDmMethod {
public void execute(Map params, OutputStream ostream) throws Exception {
// Log on the to docbase and get a session manager like this:
// IDfSessionManager sessionMgr = dfClient.newSessionManager();
// and get a session from the session manager
// Add your business logic here
} catch (DfException e) {
ostream.write("A DfException occurred".getBytes());
ostream.write(e.getMessage().getBytes());
e.printStackTrace();
} finally {
// If session is not null release the session to the
// session manager here.
}
}
Java Method Server - Deployment
Deployment
Compile the method (i.e.: MyServerMethod.class)
Stop TomCAT if running
Copy your method to $DM_HOME/dba/java_methods
Restart TomCAT
Open Documentum Administrator
Click Administration > Job Management > Methods (left pane)
Click File > New > Method (menu bar)
Write a name for your method (i.e.: dmc_MyServerMethod)
Write a verb (better use fully-qualified name of your method class)
Select java as Method Type
Check Run As Server (to get all privileges)
Uncheck Launch Direct (to prevent OS's execution)
Check Use Method Server
Click Finish
Java Method Server Tracing & Server Start-up
Tracing
Outputs and logs of JMs could be activated
Open $DM_HOME/tomcat/webapps/DmMethods/WEBINF/web.xml
Set the trace parameter to true for the servlet DoMethod
<init-param>
<param-name>trace</param-name>
<param-value>t</param-value>
</init-param>
Logs are stored in $DM_HOME/tomcat/logs
Running JM Server
Binaries are located in $DM_HOME/tomcat/bin
Windows: Start > Programs > Administrative Tools > Services
Java Method Server Checking JM Server
Checking JM Server
URL: http://<host>:9080/DmMethods/servlet/DoMethod
You should see Documentum Java Method Server
Java Method Server Known Issues
Known Issues
Asynchronous method execution is to avoid
Sessions opened are limited
The execution agent launches hundreds or more external method processes
=> Higher load on Content Server and Oracle Database
TomCAT's limitation of simultaneous processes is weak
Synchronous method execution could fail
Under heavy load, DO_METHOD method fails
Whenever your application gets a failure, keep retrying
Thank you very much!
V mulumesc !