Write a Java class with main inside my.amp (repo amp only) - and execute that driver class

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Member II

Write a Java class with main inside my.amp (repo amp only) - and execute that driver class

Inside the amp file (my.amp), I have a Java class (Hello.java) .

In this Hello.java (which is a driver class), I have code as:

public static void main(String[] args){

// some code

}

After deploy, the code of this Hello.java will get compiled into the jar file, that is found under D:\Alfresco\tomcat\webapps\alfresco\WEB-INF\lib 

My question is, how can I run/execute the Hello.java, after deploy?

In other words, the deployed amp file has a jar file with a driver code, and how to execute it?

Perhaps I could write the client code (Hello.java) outside of amp and deploy it in another machine. However, it would be ideal if I could deploy it within the amp. I do not plan to use any Share UI, or any other Alfresco component to execute this Hello.java driver class. but run it using either command line prompt, or run this on a schedule.

1 Reply
Highlighted
Senior Member II

Re: Write a Java class with main inside my.amp (repo amp only) - and execute that driver class

Hi,

Yuo can use scheduler to execute your logic.

Scheduler 

Thanks & Regard,
Sanjay