I want to know how to use WorkManager in Tomcat 7. I came across the open source library Foo-CommonJ but nowhere i found a sample code explaning the usage. The input parameter for FooWorkManager's constructor is an instance of commonj.work.work class, where as no one provides the commonj.work.work class (neither tomcat nor foo-commonj). Basically i need a sample code explaining usage of WorkManager (FooCommonj jar) in tomcat. And if Foo-Commonj doesn't support workmanager properly, then some alternative.
Need sample code explaning Workmanager in Tomcat
4.7k Views Asked by Prabal Nandi At
2
There are 2 best solutions below
0
Talijanac
On
Old school way
Copy to tomcat\lib folder following jars:
- commonj-xxx.jar
- tomcat-commonj-xxx.jar
In context.xml of your app or tomcat create a new WorkManager instance:
<Resource name="wm/myWorkManager" type="commonj.work.WorkManager" auth="Container"
factory="de.myfoo.commonj.work.FooWorkManagerFactory"
maxThreads="10"
minThreads="5" />
Fetch this instance using JNDI. For example using web.xml:
<resource-ref>
<description>Work manager example</description>
<res-ref-name>wm/myWorkManager"</res-ref-name>
<res-type>commonj.work.WorkManager</res-type>
<res-auth>Container</res-auth>
<res-sharing-scope>Unshareable</res-sharing-scope>
</resource-ref>
Any other way should work.
Related Questions in MULTITHREADING
- How can I outsource worker processes within a for loop?
- OpenMP & oneTbb difference
- Receiving Notifications for Individual Task Completion OmniThreadLibrary Parallel.ForEach
- C++ error: no matching member function for call to 'enqueue' futures.emplace_back(TP.enqueue(sum_plus_one, x, &M));
- How can I create a thread in Haskell that will restart if it gets killed due to any reason?
- Qt: running callback in the main thread from the worker thread
- Using `static` on a AVX2 counter function increases performance ~10x in MT environment without any change in Compiler optimizations
- Heap sort with multithreading
- windows multithreading CreateMutex
- The problem of "fine-grained locks and two-phase locking algorithm"
- OpenMP multi-threading not working if OpenMPI set to use one or two MPI processor
- WPF Windows Initializing is locking the separated thread in .Net 8
- TCP Client Losing Connection When Writing Data
- vc++ thread constructor throwing compiler error c2672
- ASP.NET Core 6 Web API : best way to pause before resending email
Related Questions in TOMCAT
- Unable to compile the class for JSP in tomcat 8.5.95
- detect catalina.out log path from a running tomcat on non-Windows
- Tomcat 9.0.80 with Open JDK (JRE only) v16.0.2 crashing/unresponsive several times a day with load: Thread Count hits Max and All Threads are Busy
- JAX-RS webapp deployed to Tomcat returns HTTP 404 error while it works fine in Eclipse
- Illegal access: this web application instance has been stopped already. Could not load [org.apache.logging.log4j.message.SimpleMessage]
- File Upload Handling: Inconsistent HTTP Response Codes for Different File Sizes with Exception in Tomcat
- Don't get any public folder when deployment in svelte kit app
- Accessing solr web interface behind reverse proxy returns "Content Encoding Error"
- java.lang.UnsatisfiedLinkError: org.apache.tomcat.jni.SSL.renegotiatePending(J)I
- Cannot decrypt the password in application.yml properly if war file in the tomcat/webapps
- how to deploy mock json data api's(json-server) and angular 17 application in apache tomcat server 9 version
- version compatibility issue between spring boot, struts2-core and tomcat-embed-jasper in web application
- Is there any possibility to use JTA with Spring Framework 6 and Tomcat or Payara?
- Eclipse issue with publishing to Tomcat server
- null in Camunda variables
Related Questions in ASYNCHRONOUS
- Callback and Microtask Queue of Java Script
- Occasional crash at NSURLSessionDataTask dataTaskWithRequest:completionHandler:
- Musical chairs: How can an asynchronous task cancel a synchronous one in c#?
- Asynchronously add to queue, synchronously process it
- Sending asynchronous requests without a pre-defined task list
- Value of a variable remains unaltered when assigned during a loop
- How to efficiently test some HTTP proxies for accessing a specific domain?
- How do you update Celery Task State/Status to see it in Flower?
- Why use tasks and async await in C# inline?
- NEXTJS14 DRIZZLE : Async issue when trying to post data from component into DB
- Blocking wait on future OUTSIDE of async functions
- save to csv simultaneously opcua datachange notification
- How can I load data from secrets-manager synchronously in TypeScript
- How to avoid timeout of API before ending?
- Conditional Synchronous Import in JavaScript, to export a simple object and not promise, possible?
Related Questions in WORKMANAGERS
- Issue with Hilt integration in WorkManagerApplication
- Workmanager starts itself again when app is killed in flutter
- Flutter: How to pause music playing with cron [workmanager]?
- Flutter schedule a task for specific time like midnight for pedometer app
- How to make WorkManager alive when app is killed?
- How to run long task while flutter app is in background
- How to pass json argument to a BGTaskScheduler
- Flutter alarm manager not work when closed app
- Can OneTimeWorkRequest and PeriodicWorkRequest be used together?
- Ongoin use of variable in Worker class Android
- E/WM-WorkerFactory: Could not instantiate com.xyz.XYZWorker
- websphere work manager exceeding max threads
- For how long can a Worker in Android keep retrying doing a request?
- How can I use a parameter from sharedPreferences in workmanager in Flutter?
- java.lang.IllegalStateException: WorkManager is already initialized. Even though work manager is not initialized
Related Questions in COMMONJ
- Websphere workmanager alternative
- Get Date from a DataObject (SDO) without losing the hour (JAVA)
- Enable programmatic concurrency on Jetty with WorkManager
- Setting up a CommonJ Timer Manager in Websphere
- How to notify mainthread when completing WorkEvent with exception?
- commonj workmanager in jboss threads not waiting to complete
- Mapping commonj work manager with weblogic work manager fails with NameNotFoundException
- Common timeout across ExecutorChannel threads
- How to get a JCA Workmanager on Websphere 8 for Springs WorkManagerTaskExecutor
- How to configure spring commonj workManager in webSphere liberty profile server 8.5
- Using a Commonj Work Manager to send Asynchronous HTTP calls
- Why is Weblogic work manager is rejecting work
- How to implement CommonJ Work Manager with WebSphere?
- Execute the Timer once a week
- Custom Thread on Weblogic Server 11g
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
JSR-237 has been withdrawn, but it has been merged with JSR-236. http://jcp.org/en/jsr/detail?id=237 Reason: JSR 237 has been merged with JSR 236, providing a single, consistent specification for Java EE concurrency.