<booleanAttribute key="M2_DEBUG_OUTPUT" value="false"/>\r
<stringAttribute key="M2_GOALS" value="deploy"/>\r
<booleanAttribute key="M2_NON_RECURSIVE" value="false"/>\r
-<booleanAttribute key="M2_OFFLINE" value="true"/>\r
+<booleanAttribute key="M2_OFFLINE" value="false"/>\r
<stringAttribute key="M2_PROFILES" value=""/>\r
<listAttribute key="M2_PROPERTIES"/>\r
<stringAttribute key="M2_RUNTIME" value="EMBEDDED"/>\r
export SHLIB_PATH=/opt/tivoli/tsm/client/ba/bin:/opt/tivoli/tsm/client/api/bin64
export TZ=NFT-1DFT,M3.5.0,M10.5.0
export PATH=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.102-4.b14.el7.x86_64/bin:$PATH
-./mediacube
\ No newline at end of file
+nohup ./mediacube &
\ No newline at end of file
<properties>\r
<project.version>1.0.0</project.version>\r
<tycho.version>1.0.0</tycho.version>\r
+ <maven.compiler.source>1.8</maven.compiler.source>\r
+ <maven.compiler.target>1.8</maven.compiler.target>\r
+ <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>\r
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>\r
\r
<remote.address>scp://root:password@10.10.1.28</remote.address>\r
\r
<build>\r
<plugins>\r
+<!-- <plugin> -->\r
+<!-- <groupId>org.apache.maven.plugins</groupId> -->\r
+<!-- <artifactId>maven-compiler-plugin</artifactId> -->\r
+<!-- <version>3.7.0</version> -->\r
+<!-- <configuration> -->\r
+<!-- <source>1.8</source> -->\r
+<!-- <target>1.8</target> -->\r
+<!-- </configuration> -->\r
+<!-- </plugin> -->\r
<plugin>\r
<groupId>org.eclipse.tycho</groupId>\r
<artifactId>tycho-packaging-plugin</artifactId>\r
</Console>\r
<HTMLMailAppender name="MarkeredMail" subject="MediaCube rendszerüzenet" to="vasary@elgekko.net" from="mediacubeserver@gmail.com" smtpHost="smtp.gmail.com"\r
smtpPort="465" smtpProtocol="smtps" smtpUsername="mediacubeserver@gmail.com" smtpPassword="salabakter" ignoreExceptions="false" bufferSize="1">\r
- <MarkerFilter marker="INFO-MARKER" onMatch="ACCEPT" onMismatch="DENY" />\r
+ <Filters>\r
+ <MarkerFilter marker="Archiválás" onMatch="ACCEPT" onMismatch="DENY" />\r
+ </Filters>\r
<PatternLayout pattern="%d{HH:mm:ss.SSS} %-5level %logger{1}.%M - %msg (%F:%L) %n" />\r
</HTMLMailAppender>\r
<RollingFile name="MarkeredRollingFile" fileName="${markeredFileName}" filePattern="${markeredFilePattern}">\r
+ <Filters>\r
+ <MarkerFilter marker="Archiválás" onMatch="ACCEPT" onMismatch="DENY" />\r
+ </Filters>\r
<PatternLayout pattern="%d{HH:mm:ss.SSS} [%-5level] [%t] [%M] [%class{36}] %msg%n %throwable{short}" />\r
<Policies>\r
<TimeBasedTriggeringPolicy />\r
<AppenderRef ref="Console" />\r
<AppenderRef ref="MarkeredConsole" />\r
- <AppenderRef ref="RollingFile" />\r
-- <AppenderRef ref="RollingFileEceptions" />\r
+- <AppenderRef ref="RollingFileExceptions" />\r
- <AppenderRef ref="MarkeredRollingFile" />\r
<!-- <AppenderRef ref="MarkeredMail" /> -->\r
</Root>\r
</configIni>\r
\r
<launcherArgs>\r
- <programArgs>-consoleLog -console\r
+ <programArgs>-consoleLog -console 5555\r
</programArgs>\r
- <vmArgs>-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8888
--Djavax.ws.rs.ext.RuntimeDelegate=org.jboss.resteasy.spi.ResteasyProviderFactory
-
-#System
--Dorg.eclipse.equinox.http.jetty.http.port=8080
--Dorg.eclipse.epp.logging.aeri.skipReports=true
--Declipse.ignoreApp=true
--Dosgi.noShutdown=true
--Djetty.home=./configuration/jetty
--Djetty.etc.config.urls=etc/user-jetty.xml,etc/user-jetty-ssl.xml,etc/user-jetty-ssl-context.xml,etc/user-jetty-http.xml,etc/user-jetty-https.xml
--Dlog4j.configurationFile=./configuration/log4j2.xml
--Djobengine.loglevel=INFO
--Djobengine.jobsteps.root=./configuration/executors
--Djobengine.jobtemplates.root=./configuration/jobtemplates
+ <vmArgs>-Dfile.encoding=UTF-8\r
+-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8888\r
+-Djavax.ws.rs.ext.RuntimeDelegate=org.jboss.resteasy.spi.ResteasyProviderFactory\r
+\r
+#System\r
+-Dorg.eclipse.equinox.http.jetty.http.port=8080\r
+-Dorg.eclipse.epp.logging.aeri.skipReports=true \r
+-Declipse.ignoreApp=true \r
+-Dosgi.noShutdown=true\r
+-Djetty.home=./configuration/jetty\r
+-Djetty.etc.config.urls=etc/user-jetty.xml,etc/user-jetty-ssl.xml,etc/user-jetty-ssl-context.xml,etc/user-jetty-http.xml,etc/user-jetty-https.xml\r
+-Dlog4j.configurationFile=./configuration/log4j2.xml\r
+-Djobengine.loglevel=INFO\r
+-Djobengine.jobsteps.root=./configuration/executors\r
+-Djobengine.jobtemplates.root=./configuration/jobtemplates\r
-Djobengine.jobscheduling.config=./configuration/scheduledjobs.json\r
</vmArgs>\r
- <vmArgsLin>#Database\r
--Djobengine.db.url=jdbc:db2://localhost:50000/mc:retrieveMessagesFromServerOnGetMessage=true;\r
--Djobengine.db.user=db2admin\r
--Djobengine.db.password=password\r
--Djobengine.nosql.db.url=jdbc:db2://localhost:50000/mc:retrieveMessagesFromServerOnGetMessage=true;\r
--Djobengine.nosql.db.user=db2admin\r
--Djobengine.nosql.db.password=password\r
--Djobengine.nosql.db.schema=test\r
-\r
-#Octopus\r
--Djobengine.octopus.api.address=http://10.10.1.11/api/v1\r
--Djobengine.octopus.api.user=mam\r
--Djobengine.octopus.api.password=napocska\r
-\r
-#Selenio\r
--Djobengine.selenio.address=http://10.10.1.71:44000/TranscodeMgrWS?wsdl\r
--Djobengine.selenio.projectfilepath=\\10.10.1.71\Data\Blueprints\MP4_H264_AAC_v4.zenium\r
-\r
-#Nexio\r
+ <vmArgsLin>#Database
+-Djobengine.db.url=jdbc:db2://localhost:50000/mc:retrieveMessagesFromServerOnGetMessage=true;
+-Djobengine.db.user=db2admin
+-Djobengine.db.password=password
+-Djobengine.nosql.db.url=jdbc:db2://localhost:50000/mc:retrieveMessagesFromServerOnGetMessage=true;
+-Djobengine.nosql.db.user=db2admin
+-Djobengine.nosql.db.password=password
+-Djobengine.nosql.db.schema=test
+
+#Octopus
+-Djobengine.octopus.api.address=http://10.10.1.11/api/v1
+-Djobengine.octopus.api.user=mam
+-Djobengine.octopus.api.password=napocska
+
+#Selenio
+-Djobengine.selenio.address=http://10.10.1.71:44000/TranscodeMgrWS?wsdl
+-Djobengine.selenio.projectfilepath=\\10.10.1.71\Data\Blueprints\MP4_H264_AAC_v4.zenium
+
+#Nexio
-Dnexio.host=10.10.1.55\r
</vmArgsLin>\r
<vmArgsMac>-XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts\r
</vmArgsMac>\r
- <vmArgsWin>#Database\r
--Djobengine.db.url=jdbc:db2://10.228.198.1:50000/mediaarc:retrieveMessagesFromServerOnGetMessage=true;\r
--Djobengine.db.user=db2admin\r
--Djobengine.db.password=password\r
--Djobengine.nosql.db.url=jdbc:db2://10.228.198.1:50000/mccache:retrieveMessagesFromServerOnGetMessage=true;\r
--Djobengine.nosql.db.user=db2admin\r
--Djobengine.nosql.db.password=password\r
--Djobengine.nosql.db.schema=test\r
-\r
-#Octopus\r
--Djobengine.octopus.api.address=http://10.10.1.11/api/v1\r
--Djobengine.octopus.api.user=mam\r
--Djobengine.octopus.api.password=napocska\r
-\r
-#Selenio\r
--Djobengine.selenio.address=http://10.10.1.71:44000/TranscodeMgrWS?wsdl\r
--Djobengine.selenio.projectfilepath=\\10.10.1.71\Data\Blueprints\MP4_H264_AAC_v4.zenium\r
-\r
-#Nexio\r
+ <vmArgsWin>#Database
+-Djobengine.db.url=jdbc:db2://10.228.198.1:50000/mediaarc:retrieveMessagesFromServerOnGetMessage=true;
+-Djobengine.db.user=db2admin
+-Djobengine.db.password=password
+-Djobengine.nosql.db.url=jdbc:db2://10.228.198.1:50000/mccache:retrieveMessagesFromServerOnGetMessage=true;
+-Djobengine.nosql.db.user=db2admin
+-Djobengine.nosql.db.password=password
+-Djobengine.nosql.db.schema=test
+
+#Octopus
+-Djobengine.octopus.api.address=http://10.10.1.11/api/v1
+-Djobengine.octopus.api.user=mam
+-Djobengine.octopus.api.password=napocska
+
+#Selenio
+-Djobengine.selenio.address=http://10.10.1.71:44000/TranscodeMgrWS?wsdl
+-Djobengine.selenio.projectfilepath=\\10.10.1.71\Data\Blueprints\MP4_H264_AAC_v4.zenium
+
+#Nexio
-Dnexio.host=10.10.1.55\r
</vmArgsWin>\r
</launcherArgs>\r
<argument>"synchronize remote"</argument>\r
<argument>"call chmod +x mediacube"</argument>\r
<argument>"call chmod +x start-mediacube.sh"</argument>\r
- <argument>"call nohup ./start-mediacube.sh &"</argument>\r
+ <argument>"call ./start-mediacube.sh"</argument>\r
<argument>"exit"</argument>\r
</arguments>\r
</configuration>\r
<executor className="user.jobengine.server.steps.CheckTrafficMissingMaterialsStep" maxConcurrent="1"/>\r
<executor className="user.jobengine.server.steps.DeleteMaterialsStep" maxConcurrent="1"/>\r
<executor className="user.jobengine.server.steps.DeleteNEXIOMaterialsStep" maxConcurrent="1"/>\r
- <executor className="user.jobengine.server.steps.FakeStep" maxConcurrent="10"/>\r
+ <executor className="user.jobengine.server.steps.FakeStep" maxConcurrent="1"/>\r
<executor className="user.jobengine.server.steps.MetadataTransformStep" maxConcurrent="1"/>\r
<executor className="user.jobengine.server.steps.SyncOCTOPUSDataStep" maxConcurrent="1"/>\r
<executor className="user.jobengine.server.steps.TranscodeSELENIOStep" maxConcurrent="1"/>\r
@ECHO OFF\r
\r
-SET REMOTE_HOST=10.10.1.26\r
+SET REMOTE_HOST=10.10.1.28\r
SET REMOTE_LOCATION=/opt/mediacube/configuration/executors\r
SET REMOTE_SERVER_HOSTKEY=ssh-rsa 2048 7e:0a:bb:8b:38:0f:22:c3:81:d4:1a:44:f3:91:ea:1f\r
SET REMOTE_SERVER_ADDRESS=scp://root:password@%REMOTE_HOST%\r
<?xml version="1.0" encoding="UTF-8"?>\r
-<jobtemplate name="Anyag archiválása">\r
+<jobtemplate name="Anyag archiválása" multiInstance="true">\r
<declarations>\r
<parameters>\r
<parameter name="archiveItem" type="user.jobengine.server.steps.ArchiveItem" />\r
* @author robi\r
*/\r
public class ArchiveMaterialSubmitStep extends JobStep {\r
+ private static final String ARCHIVE = "Archiválás";\r
private static final String GLOBAL_INPUT_FOLDER = "globalInputFolder";\r
private static final Logger logger = LogManager.getLogger();\r
private static final String JOBTEMPLATE = "archive-material.xml";\r
public Object[] execute(String globalInputFolder, ArrayList<ArchiveItem> archiveList, IJobEngine jobEngine, IJobRuntime jobRuntime) {\r
try {\r
for (ArchiveItem archiveItem : archiveList) {\r
- String title = "Archiválás: " + archiveItem.getMediaFile().toFile().getName();\r
try {\r
- IJobRuntime submit = jobEngine.submit(JOBTEMPLATE, title,\r
+ IJobRuntime submit = jobEngine.submit(JOBTEMPLATE, ARCHIVE,\r
ListUtils.asMap(ARCHIVE_ITEM, archiveItem, GLOBAL_INPUT_FOLDER, globalInputFolder));\r
} catch (Exception e) {\r
if (archiveItem != null)\r
itemManager.mergeItemStructure(mediaCubeItem);\r
} catch (Exception e) {\r
logger.catching(e);\r
+ if (!archiveItem.removeCatchedFile())\r
+ logger.error(getMarker(), "A {} állomány .catched jelző állománya nem törölhető.", archiveItem.getMediaFile().toFile().getName());\r
+\r
throw e;\r
+\r
} finally {\r
jobRuntime.incrementProgress(100);\r
}\r
RemoteFile remoteFile = sourceUri.transferFrom(targetStoreUri, sourceFileName, sourceFileName);\r
\r
saveMetadata(mediaCubeMedia, sourceFileName);\r
+ logger.info(getMarker(), "A {} állomány archiválása sikeres.", archiveItem.getMediaFile().toFile().getName());\r
\r
} catch (Exception e) {\r
logger.catching(e);\r
if (!archiveItem.removeCatchedFile())\r
- logger.error("Can not delete .catched file for {}", inputFilePath.toString());\r
+ logger.error(getMarker(), "A {} állomány .catched jelző állománya nem törölhető.", archiveItem.getMediaFile().toFile().getName());\r
throw e;\r
}\r
return null;\r
+ALTER TABLE MEDIA ALTER COLUMN DESCRIPTION DROP NOT NULL\r
+ALTER TABLE ITEM ALTER COLUMN DESCRIPTION DROP NOT NULL\r
\r
ALTER TABLE MEDIAFILE ADD COLUMN HOUSEID VARCHAR(40)\r
CREATE INDEX IDX_MEDIAFILE_HOUSEID ON MEDIAFILE ("HOUSEID")\r
---execute with \r
+-execute with \r
-- db2 -td@ -vmf 2-CreateStructure.db2\r
\r
CONNECT TO MC USER db2admin USING salabakter@\r
ITEMTYPEID BIGINT NOT NULL, \r
HOUSEID VARCHAR(40), \r
TITLE VARCHAR(80) NOT NULL,\r
- DESCRIPTION VARCHAR(255) NOT NULL, \r
+ DESCRIPTION VARCHAR(255), \r
ISFOLDER CHARACTER(1) NOT NULL DEFAULT 'N',\r
CREATED TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL,\r
MODIFIED TIMESTAMP NOT NULL GENERATED BY DEFAULT FOR EACH ROW ON UPDATE AS ROW CHANGE TIMESTAMP,\r
ITEMTYPEID BIGINT NOT NULL, \r
HOUSEID VARCHAR(40), \r
TITLE VARCHAR(40) NOT NULL, \r
- DESCRIPTION VARCHAR(255) NOT NULL, \r
+ DESCRIPTION VARCHAR(255), \r
LENGTH BIGINT NOT NULL, \r
CREATED TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL,\r
MODIFIED TIMESTAMP NOT NULL GENERATED BY DEFAULT FOR EACH ROW ON UPDATE AS ROW CHANGE TIMESTAMP,\r
import user.commons.TimestampAdapter;
/**
- * Verzió Pojo osztály.
- *
+ * Verzi� Pojo oszt�ly.
+ *
* @author User
- *
+ *
*/
public class Media extends DynamicAttributes {
private static final long serialVersionUID = 1L;
return this.houseId;
}
+ public boolean getIsPartialEnabled() {
+ return isPartialEnabled;
+ }
+
public long getItemId() {
return this.itemId;
}
@SuppressWarnings("unchecked")
public List<MediaFile> getMediaFiles() {
if (mediaFiles == null)
- mediaFiles = (List<MediaFile>) (List<?>) ItemManager.getInstance()
- .getAll(MediaFile.class, getId());
+ mediaFiles = (List<MediaFile>) (List<?>) ItemManager.getInstance().getAll(MediaFile.class, getId());
return mediaFiles;
}
+ public byte[] getPoster() {
+ return poster;
+ }
+
public String getTitle() {
return title;
}
}
public void setDescription(String description) {
- checkParameter("Description", description);
+ //checkParameter("Description", description);
this.description = description;
}
houseId = id;
}
+ public void setIsPartialEnabled(boolean isPartialEnabled) {
+ this.isPartialEnabled = isPartialEnabled;
+ }
+
public void setItemId(long itemId) {
// checkParameter("ItemId", itemId);
this.itemId = itemId;
this.length = length;
}
- public void setTitle(String title) {
- checkParameter("Title", title);
- this.title = title;
- }
-
public void setMediaFiles(List<MediaFile> mediaFiles) {
this.mediaFiles = mediaFiles;
}
- public boolean getIsPartialEnabled() {
- return isPartialEnabled;
- }
-
- public void setIsPartialEnabled(boolean isPartialEnabled) {
- this.isPartialEnabled = isPartialEnabled;
- }
-
- public byte[] getPoster() {
- return poster;
- }
-
public void setPoster(byte[] poster) {
this.poster = poster;
}
+
+ public void setTitle(String title) {
+ checkParameter("Title", title);
+ this.title = title;
+ }
}
\ No newline at end of file
Bundle-ActivationPolicy: lazy
Web-ContextPath: /
Bundle-Activator: user.jobengine.osgi.server.Activator
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
<?xml version="1.0" encoding="UTF-8"?>\r
-<project\r
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"\r
- xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">\r
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"\r
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">\r
<parent>\r
<relativePath>../-modules</relativePath>\r
<groupId>user.jobengine</groupId>\r
<artifactId>user.jobengine.osgi.server</artifactId>\r
<packaging>eclipse-plugin</packaging>\r
<version>1.0.0</version>\r
-<!-- <build> -->\r
-<!-- <plugins> -->\r
-<!-- <plugin> -->\r
-<!-- <groupId>org.codehaus.mojo</groupId> -->\r
-<!-- <artifactId>exec-maven-plugin</artifactId> -->\r
-<!-- <version>1.5.0</version> -->\r
-<!-- <executions> -->\r
-<!-- <execution> -->\r
-<!-- <id>remote-deploy</id> -->\r
-<!-- <phase>deploy</phase> -->\r
-<!-- <goals> -->\r
-<!-- <goal>exec</goal> -->\r
-<!-- </goals> -->\r
-<!-- <configuration> -->\r
-<!-- <workingDirectory>${project.build.directory}</workingDirectory> -->\r
-<!-- <executable>winscp.com</executable> -->\r
-<!-- <arguments> -->\r
-<!-- <argument>/command</argument> -->\r
-<!-- <argument>"open ${remote.address} -hostkey=""${remote.hostkey}"""</argument> -->\r
-<!-- <argument>"lcd ${local.location}"</argument> -->\r
-<!-- <argument>"cd ${remote.location}"</argument> -->\r
-<!-- <argument>"synchronize remote -filemask=*.jar|*/"</argument> -->\r
-<!-- <argument>"exit"</argument> -->\r
-<!-- </arguments> -->\r
-<!-- </configuration> -->\r
-<!-- </execution> -->\r
-<!-- </executions> -->\r
-<!-- </plugin> -->\r
-<!-- </plugins> -->\r
-<!-- </build> -->\r
-<!-- <properties> -->\r
-<!-- <remote.address>scp://root:password@10.10.1.26</remote.address> -->\r
-<!-- <remote.hostkey>ssh-ed25519 256 ea:ab:67:70:79:63:2f:6a:34:81:48:e2:b9:dd:ca:d4</remote.hostkey> -->\r
-<!-- <local.location>${project.build.directory}</local.location> -->\r
-<!-- <remote.location>/opt/mediacube/plugins</remote.location> -->\r
-<!-- </properties> -->\r
+\r
+ <!-- <build> -->\r
+ <!-- <plugins> -->\r
+ <!-- <plugin> -->\r
+ <!-- <groupId>org.codehaus.mojo</groupId> -->\r
+ <!-- <artifactId>exec-maven-plugin</artifactId> -->\r
+ <!-- <version>1.5.0</version> -->\r
+ <!-- <executions> -->\r
+ <!-- <execution> -->\r
+ <!-- <id>remote-deploy</id> -->\r
+ <!-- <phase>deploy</phase> -->\r
+ <!-- <goals> -->\r
+ <!-- <goal>exec</goal> -->\r
+ <!-- </goals> -->\r
+ <!-- <configuration> -->\r
+ <!-- <workingDirectory>${project.build.directory}</workingDirectory> -->\r
+ <!-- <executable>winscp.com</executable> -->\r
+ <!-- <arguments> -->\r
+ <!-- <argument>/command</argument> -->\r
+ <!-- <argument>"open ${remote.address} -hostkey=""${remote.hostkey}"""</argument> -->\r
+ <!-- <argument>"lcd ${local.location}"</argument> -->\r
+ <!-- <argument>"cd ${remote.location}"</argument> -->\r
+ <!-- <argument>"synchronize remote -filemask=*.jar|*/"</argument> -->\r
+ <!-- <argument>"exit"</argument> -->\r
+ <!-- </arguments> -->\r
+ <!-- </configuration> -->\r
+ <!-- </execution> -->\r
+ <!-- </executions> -->\r
+ <!-- </plugin> -->\r
+ <!-- </plugins> -->\r
+ <!-- </build> -->\r
+ <!-- <properties> -->\r
+ <!-- <remote.address>scp://root:password@10.10.1.26</remote.address> -->\r
+ <!-- <remote.hostkey>ssh-ed25519 256 ea:ab:67:70:79:63:2f:6a:34:81:48:e2:b9:dd:ca:d4</remote.hostkey> -->\r
+ <!-- <local.location>${project.build.directory}</local.location> -->\r
+ <!-- <remote.location>/opt/mediacube/plugins</remote.location> -->\r
+ <!-- </properties> -->\r
</project>
\ No newline at end of file
\r
import org.apache.logging.log4j.LogManager;\r
import org.apache.logging.log4j.Logger;\r
+import org.eclipse.core.runtime.adaptor.EclipseStarter;\r
import org.eclipse.osgi.framework.console.CommandInterpreter;\r
import org.eclipse.osgi.framework.console.CommandProvider;\r
+import org.osgi.framework.BundleContext;\r
+import org.osgi.framework.FrameworkUtil;\r
+import org.osgi.framework.ServiceReference;\r
\r
+import user.jobengine.server.IJobEngine;\r
+\r
+// Bundle[] bundles = bundleContext.getBundles();\r
+// for (Bundle b : bundles) {\r
+// if ((b.adapt(BundleRevision.class).getTypes() & BundleRevision.TYPE_FRAGMENT) != 0)\r
+// continue;\r
+// if ("org.eclipse.equinox.ds".equals(b.getSymbolicName()))\r
+// continue;\r
+// if ("user.jobengine.osgi.commons".equals(b.getSymbolicName()))\r
+// continue;\r
+//\r
+// logger.info("Stopping {} ", b.getSymbolicName());\r
+// b.stop();\r
+// }\r
public class ConsoleCommandProvider implements CommandProvider {\r
private static final Logger logger = LogManager.getLogger();\r
\r
@SuppressWarnings("restriction")\r
public Object _halt(CommandInterpreter intp) {\r
- StringBuffer buffer = new StringBuffer();\r
- // Thread shutdownThread = new Thread(() -> {\r
- // try {\r
- // Thread.sleep(1000);\r
- // BundleContext bundleContext = FrameworkUtil.getBundle(this.getClass()).getBundleContext();\r
- // if (bundleContext != null) {\r
- // Bundle[] bundles = bundleContext.getBundles();\r
- // for (Bundle b : bundles) {\r
- // if ((b.adapt(BundleRevision.class).getTypes() & BundleRevision.TYPE_FRAGMENT) != 0)\r
- // continue;\r
- // if ("org.eclipse.equinox.ds".equals(b.getSymbolicName()))\r
- // continue;\r
- // if ("user.jobengine.osgi.commons".equals(b.getSymbolicName()))\r
- // continue;\r
- //\r
- // logger.info("Stopping {} ", b.getSymbolicName());\r
- // b.stop();\r
- // }\r
- // }\r
- // EclipseStarter.shutdown();\r
- //\r
- // System.exit(0);\r
- // } catch (Exception e) {\r
- // logger.error("Error:", e);\r
- // }\r
- // });\r
- // shutdownThread.start();\r
- // buffer.append("Shutdown initiated");\r
+ final StringBuffer buffer = new StringBuffer();\r
+ Thread shutdownThread = new Thread(() -> {\r
+ try {\r
+ buffer.append("HALT");\r
+ Thread.sleep(1000);\r
+ BundleContext context = FrameworkUtil.getBundle(this.getClass()).getBundleContext();\r
+ ServiceReference<IJobEngine> reference = context.getServiceReference(IJobEngine.class);\r
+ IJobEngine jobEngine = context.getService(reference);\r
+ jobEngine.shutdown();\r
+ EclipseStarter.shutdown();\r
+\r
+ System.exit(0);\r
+ } catch (Exception e) {\r
+ logger.error("Error:", e);\r
+ }\r
+ });\r
+ shutdownThread.start();\r
buffer.append("...and catch fire!");\r
return buffer.toString();\r
}\r
/**
* Job prioritasa megvaltozott. Job main queue-ban es a JobStepExecutorok soraiban is ujra kell rendezni a jobokat. Az ujrarendezes a put-nal is megy
* automatikusan, mivel eltero prioritasu jobot dobhatnak be vagy default prioritasut a korabban atrendezett listaba.
- *
+ *
* @param jobRuntime
*/
@Override
private void shutdownExecutors() {
if (executors != null)
- for (IJobStepExecutor executor : executors.values())
+ for (IJobStepExecutor executor : executors.values()) {
+ logger.info("Stopping executor {}", executor.getStepClass());
executor.shutdown();
+ }
}
@Override