let me introduce you: dots
DESCRIPTION
Entwicklercamp 2013TRANSCRIPT
![Page 1: Let me introduce you: DOTS](https://reader036.vdocuments.site/reader036/viewer/2022062405/55540ad1b4c90544428b52ca/html5/thumbnails/1.jpg)
Let me introduce you: DOTS
Frank van der Linden
![Page 2: Let me introduce you: DOTS](https://reader036.vdocuments.site/reader036/viewer/2022062405/55540ad1b4c90544428b52ca/html5/thumbnails/2.jpg)
Frank van der Linden & e-office
nl.linkedin.com/in/flinden68
http://www.domino-weblog.nl
@flinden68
![Page 3: Let me introduce you: DOTS](https://reader036.vdocuments.site/reader036/viewer/2022062405/55540ad1b4c90544428b52ca/html5/thumbnails/3.jpg)
Roadmap
• Introduction• What is DOTS• Setup your environment • My first DOTS tasklet• Debug my first DOTS tasklet • Deploy your tasklet• Tips and tricks
![Page 4: Let me introduce you: DOTS](https://reader036.vdocuments.site/reader036/viewer/2022062405/55540ad1b4c90544428b52ca/html5/thumbnails/4.jpg)
Introduction
![Page 5: Let me introduce you: DOTS](https://reader036.vdocuments.site/reader036/viewer/2022062405/55540ad1b4c90544428b52ca/html5/thumbnails/5.jpg)
Introduction of OSGi
• Open Services Gateway initiative– Started in 1999– Still improved– module system and service platform
• OSGi bundles– Can be installed remotely.– No reboot required– Lifecycle
![Page 6: Let me introduce you: DOTS](https://reader036.vdocuments.site/reader036/viewer/2022062405/55540ad1b4c90544428b52ca/html5/thumbnails/6.jpg)
Introduction of OSGi
• OSGi and IBM Notes/Domino– Since 8.5.2– Extension points– Extension Library– DOTS (Domino OSGi Tasklet Service)– OpenSocial Container
8.5.2
8.5.3
9+
![Page 7: Let me introduce you: DOTS](https://reader036.vdocuments.site/reader036/viewer/2022062405/55540ad1b4c90544428b52ca/html5/thumbnails/7.jpg)
Introduction to DOTS
• Domino OSGi Tasklet Service– Easy development– Outside in Eclipse IDE– Tasklets can run: scheduled, manual
• Next generation agents for Domino• OpenNTF project by IBM since April, 2011
(replaced JAVADDIN project)
• Included in IBM Domino 9 Social Edition
![Page 8: Let me introduce you: DOTS](https://reader036.vdocuments.site/reader036/viewer/2022062405/55540ad1b4c90544428b52ca/html5/thumbnails/8.jpg)
Introduction to DOTS
![Page 9: Let me introduce you: DOTS](https://reader036.vdocuments.site/reader036/viewer/2022062405/55540ad1b4c90544428b52ca/html5/thumbnails/9.jpg)
Introduction to DOTS
• DOTS Tasklets outperforms over Java Agents!
Java Agent:
DOTS tasklet:
AMGR launches a
ThreadJVM Initializes
Prepare Java and JNI
interfacesLoad Agent Bytecode Run!
Run!Everything is ready to run
> tell amgr run "test\XPagescrash.nsf" 'LongJobAgent'
09.11.2012 19:38:39 JVM: Java Virtual Machine initialized.
09.11.2012 19:38:39 AMgr: Start executing agent 'LongJobAgent' in 'test\XPagescrash.nsf'
09.11.2012 19:38:39 Agent Manager: Agent printing: 181349
09.11.2012 19:41:02 Agent Manager: Agent printing: 2227
09.11.2012 19:41:02 Agent Manager: Agent printing: Finished in 143 secs... -
09.11.2012 19:41:02 AMgr: Agent 'LongJobAgent' in 'test\XPagescrash.nsf' completed execution
> load dots
> Listening for transport dt_socket at address: 8001
09.11.2012 19:42:40 Domino OSGi Tasklet Container started ( profile DOTS )
> 181349
> 2227
09.11.2012 19:43:22 [DOTS] (annotated) Finished in 41 secs...
![Page 10: Let me introduce you: DOTS](https://reader036.vdocuments.site/reader036/viewer/2022062405/55540ad1b4c90544428b52ca/html5/thumbnails/10.jpg)
Introduction to DOTS
• DOTS versus Agents– AMGR is old and complicated– Range
• Agents are database depended• DOTS run server wide
– DOTS are more flexible• Precise timing
![Page 11: Let me introduce you: DOTS](https://reader036.vdocuments.site/reader036/viewer/2022062405/55540ad1b4c90544428b52ca/html5/thumbnails/11.jpg)
Setup your environment
![Page 12: Let me introduce you: DOTS](https://reader036.vdocuments.site/reader036/viewer/2022062405/55540ad1b4c90544428b52ca/html5/thumbnails/12.jpg)
Setup your environment
• DOTS should be installed into IBM Domino server– For IBM Domino 9 Social Edition Public Beta, you
don’t need to do anything.– For versions 8.5.2 and 8.5.3,
• Download DOTS package from OpenNTF• You will also need some Eclipse plugins from Eclipse
3.6.2+
![Page 13: Let me introduce you: DOTS](https://reader036.vdocuments.site/reader036/viewer/2022062405/55540ad1b4c90544428b52ca/html5/thumbnails/13.jpg)
Setup your environment
• Create some folders inside your Domino folder– [Domino Program Files]\osgi-dots\rcp\eclipse\plugins– [Domino Program Files]\osgi-dots\shared\eclipse\plugins
• Copy files from Eclipse install directory
These plugins will be copied
from Eclipse installation
[Eclipse]\plugins
![Page 14: Let me introduce you: DOTS](https://reader036.vdocuments.site/reader036/viewer/2022062405/55540ad1b4c90544428b52ca/html5/thumbnails/14.jpg)
Setup your environment
• The DOTS package contains the executables– The jar files in the newly created directories– The executables in the Domino program directory
Copy to
[Domino]\osgi-dots\shared\eclipse\plugins
Copy to
[Domino]\osgi-dots
![Page 15: Let me introduce you: DOTS](https://reader036.vdocuments.site/reader036/viewer/2022062405/55540ad1b4c90544428b52ca/html5/thumbnails/15.jpg)
Setup your environment
• The DOTS package contains the executables– The jar files in the newly created directories– The executables in the Domino program directory
Copy to
[Domino]\osgi-dots\shared\eclipse\plugins
Copy to
[Domino]\osgi-dots
![Page 16: Let me introduce you: DOTS](https://reader036.vdocuments.site/reader036/viewer/2022062405/55540ad1b4c90544428b52ca/html5/thumbnails/16.jpg)
Setup your environment
• Download Eclipse– http://www.eclipse.org/downloads– Eclipse >3.6.2(Eclipse IDE for Java EE Developers)
• Download projects from OpenNTF– Domino Debug Plug-in from XPages SDK for Eclipse RCP: http://
tiny.cc/XPagesSDK
![Page 17: Let me introduce you: DOTS](https://reader036.vdocuments.site/reader036/viewer/2022062405/55540ad1b4c90544428b52ca/html5/thumbnails/17.jpg)
Setup the Domino Debug Plugin
• Accept all next steps
• Restart Eclipse
![Page 18: Let me introduce you: DOTS](https://reader036.vdocuments.site/reader036/viewer/2022062405/55540ad1b4c90544428b52ca/html5/thumbnails/18.jpg)
Setup the Domino Debug Plugin
• Check Preferences,if Domino Debug Plugin is installed
![Page 19: Let me introduce you: DOTS](https://reader036.vdocuments.site/reader036/viewer/2022062405/55540ad1b4c90544428b52ca/html5/thumbnails/19.jpg)
Setup the target platform
[Domino Program Files]\osgi-dots\rcp\eclipse
[Domino Program Files]\osgi-dots\rcp\eclipse
![Page 20: Let me introduce you: DOTS](https://reader036.vdocuments.site/reader036/viewer/2022062405/55540ad1b4c90544428b52ca/html5/thumbnails/20.jpg)
Setup the Notes Java Api reference
![Page 21: Let me introduce you: DOTS](https://reader036.vdocuments.site/reader036/viewer/2022062405/55540ad1b4c90544428b52ca/html5/thumbnails/21.jpg)
My first DOTS tasklet
![Page 22: Let me introduce you: DOTS](https://reader036.vdocuments.site/reader036/viewer/2022062405/55540ad1b4c90544428b52ca/html5/thumbnails/22.jpg)
My First DOTS tasklet
• Create a new Plug-in Project– File New Plug-in Project
![Page 23: Let me introduce you: DOTS](https://reader036.vdocuments.site/reader036/viewer/2022062405/55540ad1b4c90544428b52ca/html5/thumbnails/23.jpg)
My First DOTS tasklet
• Prepare the DOTS extensions
![Page 24: Let me introduce you: DOTS](https://reader036.vdocuments.site/reader036/viewer/2022062405/55540ad1b4c90544428b52ca/html5/thumbnails/24.jpg)
My First DOTS tasklet
• Import DOTS extensions– Deselect «Show only extension points from the required
plug-ins»– Find & pick «com.ibm.dots.task» extension from the list– Correct the warning in the Manifest.mf tab, then Save &
Close Manifest view.
![Page 25: Let me introduce you: DOTS](https://reader036.vdocuments.site/reader036/viewer/2022062405/55540ad1b4c90544428b52ca/html5/thumbnails/25.jpg)
My First DOTS tasklet
• Import Domino package
![Page 26: Let me introduce you: DOTS](https://reader036.vdocuments.site/reader036/viewer/2022062405/55540ad1b4c90544428b52ca/html5/thumbnails/26.jpg)
My First DOTS tasklet
• Create the Java class
![Page 27: Let me introduce you: DOTS](https://reader036.vdocuments.site/reader036/viewer/2022062405/55540ad1b4c90544428b52ca/html5/thumbnails/27.jpg)
My First DOTS tasklet
• Add some code
![Page 28: Let me introduce you: DOTS](https://reader036.vdocuments.site/reader036/viewer/2022062405/55540ad1b4c90544428b52ca/html5/thumbnails/28.jpg)
My First DOTS tasklet
• Modify the plugin.xml
tasklet id
name of the class
![Page 29: Let me introduce you: DOTS](https://reader036.vdocuments.site/reader036/viewer/2022062405/55540ad1b4c90544428b52ca/html5/thumbnails/29.jpg)
My First DOTS tasklet
• Now we can run our tasklet• DOTS will run on the Domino server• There are two ways to run from Eclipse IDE
– Run– Run and debug
![Page 30: Let me introduce you: DOTS](https://reader036.vdocuments.site/reader036/viewer/2022062405/55540ad1b4c90544428b52ca/html5/thumbnails/30.jpg)
My First DOTS tasklet
• Create a “run configuration”
![Page 31: Let me introduce you: DOTS](https://reader036.vdocuments.site/reader036/viewer/2022062405/55540ad1b4c90544428b52ca/html5/thumbnails/31.jpg)
My First DOTS tasklet
• PDE Configuration file should be created, the first time
• PDE file is created in the dots workspace
![Page 32: Let me introduce you: DOTS](https://reader036.vdocuments.site/reader036/viewer/2022062405/55540ad1b4c90544428b52ca/html5/thumbnails/32.jpg)
My First DOTS tasklet
• Now, lets run the tasklet
![Page 33: Let me introduce you: DOTS](https://reader036.vdocuments.site/reader036/viewer/2022062405/55540ad1b4c90544428b52ca/html5/thumbnails/33.jpg)
Debug a DOTS tasklet
• Stop DOTS task– Tell dots quit
• Adding debug parameters to notes.ini– DOTS_DEBUGADDRESS=8001– DOTS_DEBUGSUSPEND=y
• Reload DOTS task– Load dots– Dots task will start only when debugger connects
![Page 34: Let me introduce you: DOTS](https://reader036.vdocuments.site/reader036/viewer/2022062405/55540ad1b4c90544428b52ca/html5/thumbnails/34.jpg)
Debug my first DOTS tasklet
• Server needs to know what to debug
![Page 35: Let me introduce you: DOTS](https://reader036.vdocuments.site/reader036/viewer/2022062405/55540ad1b4c90544428b52ca/html5/thumbnails/35.jpg)
Debug my first DOTS tasklet
• Adding breakpoint to debug the code
![Page 36: Let me introduce you: DOTS](https://reader036.vdocuments.site/reader036/viewer/2022062405/55540ad1b4c90544428b52ca/html5/thumbnails/36.jpg)
Debug my first DOTS tasklet
• Some tips– Schedule tasks
– OSGi allows you to refresh bundles without restart, here is how:• Find out the «bundle-id» for the plug-in• Refresh the bundle
![Page 37: Let me introduce you: DOTS](https://reader036.vdocuments.site/reader036/viewer/2022062405/55540ad1b4c90544428b52ca/html5/thumbnails/37.jpg)
Debug my first DOTS tasklet
• More tips...Annotations– Annotations is supported in DOTS.– Powerfull way of specify for each method, what to do
@RunOnStart
public void runOnStart( IProgressMonitor monitor ){
logMessage("Annotated onStart method");
}
@Run( id="manual")
public void runManual( String[] args, IProgressMonitor monitor ){
logMessage("Annotated run method with id=manual");
}
@RunOnStart
@RunEvery( every=60, unit=RunUnit.second )
@HungPossibleAfter( timeInMinutes=1 )
public void runEvery60seconds( IProgressMonitor monitor ){
logMessage( "Called from annotated method every 60 seconds");
}
![Page 38: Let me introduce you: DOTS](https://reader036.vdocuments.site/reader036/viewer/2022062405/55540ad1b4c90544428b52ca/html5/thumbnails/38.jpg)
Deploy your tasklet
![Page 39: Let me introduce you: DOTS](https://reader036.vdocuments.site/reader036/viewer/2022062405/55540ad1b4c90544428b52ca/html5/thumbnails/39.jpg)
Deploy your tasklet
• DOTS plugins can be deployed as OSGi bundle– As jar file in OSGi plugins folder– As update site
• Disable debug parameters– Delete PDE runtime configuration (pde.launch.ini)– Disable suspend feature in debugging (DOTS_DEBUGSUSPEND)
![Page 40: Let me introduce you: DOTS](https://reader036.vdocuments.site/reader036/viewer/2022062405/55540ad1b4c90544428b52ca/html5/thumbnails/40.jpg)
Deploy your tasklet
• Create a jar file from the plugin• Right Click Export Deployable plug-ins and fragments...
![Page 41: Let me introduce you: DOTS](https://reader036.vdocuments.site/reader036/viewer/2022062405/55540ad1b4c90544428b52ca/html5/thumbnails/41.jpg)
Deploy your tasklet
• Select the plugin and destination• Place exported JAR file into plugins folder, then
restart DOTS task[Domino Program Files]\osgi-dots\shared\eclipse\plugins
![Page 42: Let me introduce you: DOTS](https://reader036.vdocuments.site/reader036/viewer/2022062405/55540ad1b4c90544428b52ca/html5/thumbnails/42.jpg)
Deploy your Tasklet
• Another deploy method, DOTS profiles– It can stored inside a Notes database– Can run in is own profile container– With his own security settings– Can started seperatly “tell profilename run abc”
![Page 43: Let me introduce you: DOTS](https://reader036.vdocuments.site/reader036/viewer/2022062405/55540ad1b4c90544428b52ca/html5/thumbnails/43.jpg)
Deploy your Tasklet
• Creating Profile Repository as NSF– Create an empty nsf, set ACL– Configure DOTS to use profiles database
• tell dots quit• set config OSGI_CONFIGURATION_DB=dotsprofiles.nsf• load dots• tell dots profileCreate dots
– DOTS profile is created
– You can import an updatesite in the profile
![Page 44: Let me introduce you: DOTS](https://reader036.vdocuments.site/reader036/viewer/2022062405/55540ad1b4c90544428b52ca/html5/thumbnails/44.jpg)
Deploy your Tasklet
• Create a Feature project in Eclipse
![Page 45: Let me introduce you: DOTS](https://reader036.vdocuments.site/reader036/viewer/2022062405/55540ad1b4c90544428b52ca/html5/thumbnails/45.jpg)
Deploy your Tasklet
• Create the update site project in Eclipse
![Page 46: Let me introduce you: DOTS](https://reader036.vdocuments.site/reader036/viewer/2022062405/55540ad1b4c90544428b52ca/html5/thumbnails/46.jpg)
Deploy your Tasklet
• Build the update site project
![Page 47: Let me introduce you: DOTS](https://reader036.vdocuments.site/reader036/viewer/2022062405/55540ad1b4c90544428b52ca/html5/thumbnails/47.jpg)
Deploy your Tasklet
• Create an Update Site Database
![Page 48: Let me introduce you: DOTS](https://reader036.vdocuments.site/reader036/viewer/2022062405/55540ad1b4c90544428b52ca/html5/thumbnails/48.jpg)
Deploy your Tasklet
• Open OSGi profile db– Add update site database into Sites section
• Restart DOTS task
![Page 49: Let me introduce you: DOTS](https://reader036.vdocuments.site/reader036/viewer/2022062405/55540ad1b4c90544428b52ca/html5/thumbnails/49.jpg)
Tips and tricks
![Page 50: Let me introduce you: DOTS](https://reader036.vdocuments.site/reader036/viewer/2022062405/55540ad1b4c90544428b52ca/html5/thumbnails/50.jpg)
Multiple profiles
• You may create more than one profiles.– For testing– Tasklets that you use occasionally– Tasklets with different security needs– Heavily loaded Tasklets
![Page 51: Let me introduce you: DOTS](https://reader036.vdocuments.site/reader036/viewer/2022062405/55540ad1b4c90544428b52ca/html5/thumbnails/51.jpg)
Life-cycle for a scheduled Tasklet
• When a tasklet runs on schedule, DOTS class loader will create an instance from your tasklet class. This instance will not be disposed until DOTS process stops.
![Page 52: Let me introduce you: DOTS](https://reader036.vdocuments.site/reader036/viewer/2022062405/55540ad1b4c90544428b52ca/html5/thumbnails/52.jpg)
Multiple purpose Tasklet
• Same Tasklet, different Java instances• In multiple scheduled runs
– persistent objects, stays in memory
• In multiple manual runs– unloaded from memory afterwards
![Page 53: Let me introduce you: DOTS](https://reader036.vdocuments.site/reader036/viewer/2022062405/55540ad1b4c90544428b52ca/html5/thumbnails/53.jpg)
Tips and tricks
• Logging– Try not to use System.out.println. (No output to log.nsf)
– Instead, use logMessage(...) and logException(...)
• Progress Monitoring– IProgressMonitor monitor
argument passed on tasklet methods.
– Very useful for tasklets running long time.
Vector<?> views = db.getViews();
monitor.beginTask( "List the views", views.size() );
Init with # of steps
for ( Object view : views ){
if ( monitor.isCanceled() ){
break;
Break if canceled.
}
logMessage("\t" +
((View)view).getName() );
try {
Thread.sleep( 1000 );
} catch (InterruptedException e) {
e.printStackTrace();
}
monitor.worked( 1 );
One step completed
}
![Page 54: Let me introduce you: DOTS](https://reader036.vdocuments.site/reader036/viewer/2022062405/55540ad1b4c90544428b52ca/html5/thumbnails/54.jpg)
Questions
![Page 55: Let me introduce you: DOTS](https://reader036.vdocuments.site/reader036/viewer/2022062405/55540ad1b4c90544428b52ca/html5/thumbnails/55.jpg)
Contact details
nl.linkedin.com/in/flinden68
http://www.domino-weblog.nl
@flinden68