├── .gitattributes
├── .github
└── workflows
│ └── codeql-analysis.yml
├── .gitignore
├── .mvn
├── mvnw
├── mvnw.cmd
└── wrapper
│ ├── maven-wrapper.jar
│ └── maven-wrapper.properties
├── LICENSE
├── LICENSE.txt
├── README.md
├── checkstyle.xml
├── deployment
├── agent.sh
├── build.bat
├── build.sh
├── executor.c
├── server.bat
└── server.sh
├── header.txt
├── jobx-agent
├── assembly.xml
├── pom.xml
└── src
│ ├── assembly
│ ├── bin
│ │ ├── jobx.bat
│ │ ├── jobx.sh
│ │ ├── kill.sh
│ │ ├── monitor.sh
│ │ ├── setclasspath.bat
│ │ ├── setclasspath.sh
│ │ ├── shutdown.bat
│ │ ├── shutdown.sh
│ │ ├── startup.bat
│ │ └── startup.sh
│ ├── conf
│ │ ├── conf.properties
│ │ └── log4j.properties
│ ├── logs
│ │ └── .keep
│ ├── native
│ │ ├── libsigar-amd64-freebsd-6.so
│ │ ├── libsigar-amd64-linux.so
│ │ ├── libsigar-amd64-solaris.so
│ │ ├── libsigar-ia64-hpux-11.sl
│ │ ├── libsigar-ia64-linux.so
│ │ ├── libsigar-pa-hpux-11.sl
│ │ ├── libsigar-ppc-aix-5.so
│ │ ├── libsigar-ppc-linux.so
│ │ ├── libsigar-ppc64-aix-5.so
│ │ ├── libsigar-ppc64-linux.so
│ │ ├── libsigar-s390x-linux.so
│ │ ├── libsigar-sparc-solaris.so
│ │ ├── libsigar-sparc64-solaris.so
│ │ ├── libsigar-universal-macosx.dylib
│ │ ├── libsigar-universal64-macosx.dylib
│ │ ├── libsigar-x86-freebsd-5.so
│ │ ├── libsigar-x86-freebsd-6.so
│ │ ├── libsigar-x86-linux.so
│ │ ├── libsigar-x86-solaris.so
│ │ ├── sigar-amd64-winnt.dll
│ │ ├── sigar-x86-winnt.dll
│ │ └── sigar-x86-winnt.lib
│ └── temp
│ │ └── .keep
│ ├── main
│ ├── java
│ │ └── com
│ │ │ └── jobxhub
│ │ │ └── agent
│ │ │ ├── bootstrap
│ │ │ └── JobXAgent.java
│ │ │ ├── process
│ │ │ ├── ExecuteUser.java
│ │ │ ├── JobXProcess.java
│ │ │ └── ProcessException.java
│ │ │ ├── service
│ │ │ ├── AgentService.java
│ │ │ └── MonitorService.java
│ │ │ └── util
│ │ │ ├── CircularBuffer.java
│ │ │ ├── ProcessLogger.java
│ │ │ └── PropertiesLoader.java
│ └── resources
│ │ └── META-INF
│ │ └── jobx
│ │ └── com.jobxhub.rpc.ServerHandler
│ └── test
│ └── java
│ └── com
│ └── jobxhub
│ └── agent
│ └── test
│ ├── BootstrapTest.java
│ └── TestDemo.java
├── jobx-api
└── pom.xml
├── jobx-common
├── pom.xml
└── src
│ ├── main
│ ├── java
│ │ └── com
│ │ │ └── jobxhub
│ │ │ └── common
│ │ │ ├── Constants.java
│ │ │ ├── api
│ │ │ └── AgentJob.java
│ │ │ ├── exception
│ │ │ ├── ApplicationException.java
│ │ │ ├── BasicException.java
│ │ │ ├── InvalidException.java
│ │ │ ├── ParameterException.java
│ │ │ ├── PingException.java
│ │ │ ├── RpcException.java
│ │ │ ├── TimeoutException.java
│ │ │ └── UnknownException.java
│ │ │ ├── ext
│ │ │ ├── ClassMark.java
│ │ │ ├── ExtensionLoader.java
│ │ │ ├── MethodMark.java
│ │ │ └── SPI.java
│ │ │ ├── graph
│ │ │ ├── Graph.java
│ │ │ ├── KahnTopo.java
│ │ │ └── Node.java
│ │ │ ├── io
│ │ │ ├── Bytes.java
│ │ │ ├── StreamUtils.java
│ │ │ ├── UnsafeByteArrayInputStream.java
│ │ │ ├── UnsafeByteArrayOutputStream.java
│ │ │ ├── UnsafeStringReader.java
│ │ │ └── UnsafeStringWriter.java
│ │ │ ├── job
│ │ │ ├── Action.java
│ │ │ ├── AgentJob.java
│ │ │ ├── Alarm.java
│ │ │ ├── Monitor.java
│ │ │ ├── RecvieMessage.java
│ │ │ ├── Request.java
│ │ │ ├── RequestFile.java
│ │ │ ├── Response.java
│ │ │ ├── ResponseFile.java
│ │ │ ├── RpcType.java
│ │ │ └── SecureModel.java
│ │ │ ├── logging
│ │ │ ├── FormattingTuple.java
│ │ │ ├── LoggerFactory.java
│ │ │ └── MessageFormatter.java
│ │ │ ├── serialize
│ │ │ ├── Cleanable.java
│ │ │ ├── DataInput.java
│ │ │ ├── DataOutput.java
│ │ │ ├── ObjectInput.java
│ │ │ ├── ObjectOutput.java
│ │ │ ├── Serializer.java
│ │ │ ├── fastjson
│ │ │ │ ├── FastJsonObjectInput.java
│ │ │ │ ├── FastJsonObjectOutput.java
│ │ │ │ └── FastJsonSerializer.java
│ │ │ ├── fst
│ │ │ │ ├── FstFactory.java
│ │ │ │ ├── FstObjectInput.java
│ │ │ │ ├── FstObjectOutput.java
│ │ │ │ └── FstSerializer.java
│ │ │ ├── hessian2
│ │ │ │ ├── Hessian2ObjectInput.java
│ │ │ │ ├── Hessian2ObjectOutput.java
│ │ │ │ ├── Hessian2Serializer.java
│ │ │ │ └── Hessian2SerializerFactory.java
│ │ │ ├── java
│ │ │ │ ├── CompactedObjectInputStream.java
│ │ │ │ ├── CompactedObjectOutputStream.java
│ │ │ │ ├── JavaObjectInput.java
│ │ │ │ ├── JavaObjectOutput.java
│ │ │ │ └── JavaSerializer.java
│ │ │ ├── kryo
│ │ │ │ ├── CompatibleKryo.java
│ │ │ │ ├── KryoObjectInput.java
│ │ │ │ ├── KryoObjectOutput.java
│ │ │ │ ├── KryoSerializer.java
│ │ │ │ └── utils
│ │ │ │ │ ├── AbstractKryoFactory.java
│ │ │ │ │ ├── KryoUtils.java
│ │ │ │ │ ├── PooledKryoFactory.java
│ │ │ │ │ ├── PrototypeKryoFactory.java
│ │ │ │ │ └── ThreadLocalKryoFactory.java
│ │ │ ├── nativejava
│ │ │ │ ├── NativeJavaObjectInput.java
│ │ │ │ ├── NativeJavaObjectOutput.java
│ │ │ │ └── NativeJavaSerializer.java
│ │ │ └── support
│ │ │ │ ├── AbstractSerializer.java
│ │ │ │ └── SerializableClassRegistry.java
│ │ │ └── util
│ │ │ ├── AssertUtils.java
│ │ │ ├── ClassAccessor.java
│ │ │ ├── ClassHelper.java
│ │ │ ├── ClassLoaderUtils.java
│ │ │ ├── CommandUtils.java
│ │ │ ├── CommonUtils.java
│ │ │ ├── CompatibleTypeUtils.java
│ │ │ ├── ConsistentHash.java
│ │ │ ├── ContainerUtils.java
│ │ │ ├── CookieUtils.java
│ │ │ ├── DateUtils.java
│ │ │ ├── DigestUtils.java
│ │ │ ├── EnumUtil.java
│ │ │ ├── ExceptionHandler.java
│ │ │ ├── ExceptionUtils.java
│ │ │ ├── Holder.java
│ │ │ ├── HttpClientUtils.java
│ │ │ ├── HttpUtils.java
│ │ │ ├── IOUtils.java
│ │ │ ├── IPUtils.java
│ │ │ ├── IdGenerator.java
│ │ │ ├── ImageUtils.java
│ │ │ ├── IntUtils.java
│ │ │ ├── Ints.java
│ │ │ ├── LRUCache.java
│ │ │ ├── MacUtils.java
│ │ │ ├── MavenUtils.java
│ │ │ ├── MurmurHash.java
│ │ │ ├── NamedThreadFactory.java
│ │ │ ├── NetUtils.java
│ │ │ ├── ObjectUtils.java
│ │ │ ├── PojoUtils.java
│ │ │ ├── PropertyPlaceholder.java
│ │ │ ├── ProtostuffUtils.java
│ │ │ ├── RSAUtils.java
│ │ │ ├── ReflectUtils.java
│ │ │ ├── StringUtils.java
│ │ │ ├── SystemClock.java
│ │ │ ├── SystemPropertyUtils.java
│ │ │ ├── WebUtils.java
│ │ │ ├── collection
│ │ │ ├── AbstractEntry.java
│ │ │ ├── CollectionUtils.java
│ │ │ ├── ConcurrentAutoTable.java
│ │ │ ├── ConcurrentHashSet.java
│ │ │ ├── ConcurrentSet.java
│ │ │ ├── HashMap.java
│ │ │ ├── IgnoreCaseMap.java
│ │ │ ├── NonBlockingHashMap.java
│ │ │ ├── NonBlockingHashMapLong.java
│ │ │ └── ParamsMap.java
│ │ │ └── internal
│ │ │ ├── Unsafe.java
│ │ │ ├── UnsafeIntegerFieldUpdater.java
│ │ │ └── UnsafeLongFieldUpdater.java
│ └── resources
│ │ └── META-INF
│ │ └── jobx
│ │ └── com.jobxhub.common.serialize.Serializer
│ └── test
│ └── java
│ ├── RSATest.java
│ ├── SPITest.java
│ └── SyncTest.java
├── jobx-examples
├── example-hadoop
│ └── pom.xml
├── example-java
│ └── pom.xml
├── example-mybatis
│ └── pom.xml
├── example-mysql
│ └── pom.xml
├── example-oracle
│ └── pom.xml
├── example-php
│ └── pom.xml
├── example-shell
│ └── pom.xml
├── example-spark
│ └── pom.xml
├── example-spring
│ └── pom.xml
└── pom.xml
├── jobx-registry
├── pom.xml
└── src
│ ├── main
│ ├── java
│ │ └── com
│ │ │ └── jobxhub
│ │ │ └── registry
│ │ │ ├── URL.java
│ │ │ ├── api
│ │ │ ├── NotifyListener.java
│ │ │ └── Registry.java
│ │ │ └── zookeeper
│ │ │ ├── ChildListener.java
│ │ │ ├── StateListener.java
│ │ │ ├── ZookeeperClient.java
│ │ │ ├── ZookeeperRegistry.java
│ │ │ ├── ZookeeperTransporter.java
│ │ │ ├── curator
│ │ │ ├── CuratorZookeeperClient.java
│ │ │ └── CuratorZookeeperTransporter.java
│ │ │ ├── support
│ │ │ └── AbstractZookeeperClient.java
│ │ │ └── zkclient
│ │ │ ├── ZkclientZookeeperClient.java
│ │ │ └── ZkclientZookeeperTransporter.java
│ └── resources
│ │ └── META-INF
│ │ └── jobx
│ │ ├── com.jobxhub.registry.zookeeper.ZookeeperClient
│ │ └── com.jobxhub.registry.zookeeper.ZookeeperTransporter
│ └── test
│ └── java
│ └── com
│ └── jobxhub
│ └── registry
│ └── RegistryTest.java
├── jobx-rpc
├── pom.xml
└── src
│ ├── main
│ ├── java
│ │ └── com
│ │ │ └── jobxhub
│ │ │ └── rpc
│ │ │ ├── Client.java
│ │ │ ├── InvokeCallback.java
│ │ │ ├── Invoker.java
│ │ │ ├── RpcFuture.java
│ │ │ ├── Server.java
│ │ │ ├── ServerHandler.java
│ │ │ ├── mina
│ │ │ ├── MinaClient.java
│ │ │ ├── MinaClientHandler.java
│ │ │ ├── MinaCodecAdapter.java
│ │ │ ├── MinaConnectWrapper.java
│ │ │ ├── MinaServer.java
│ │ │ └── MinaServerHandler.java
│ │ │ ├── netty
│ │ │ ├── NettyChannelWrapper.java
│ │ │ ├── NettyClient.java
│ │ │ ├── NettyClientHandler.java
│ │ │ ├── NettyCodecAdapter.java
│ │ │ ├── NettyServer.java
│ │ │ ├── NettyServerHandler.java
│ │ │ └── idle
│ │ │ │ ├── IdleClientHandler.java
│ │ │ │ ├── IdleServerHandler.java
│ │ │ │ ├── JobXIdleStateHandler.java
│ │ │ │ └── domain
│ │ │ │ ├── IdleRequest.java
│ │ │ │ └── IdleResponse.java
│ │ │ └── support
│ │ │ ├── AbstractClient.java
│ │ │ └── ChannelWrapper.java
│ └── resources
│ │ └── META-INF
│ │ └── jobx
│ │ ├── com.jobxhub.rpc.Client
│ │ └── com.jobxhub.rpc.Server
│ └── test
│ └── java
│ ├── NettyFileTest.java
│ └── SPITest.java
├── jobx-server
├── pom.xml
└── src
│ ├── main
│ ├── java
│ │ └── com
│ │ │ └── jobxhub
│ │ │ └── server
│ │ │ ├── alarm
│ │ │ ├── AbstractSendNotice.java
│ │ │ ├── AlarmMessage.java
│ │ │ ├── AlarmNoticeFacory.java
│ │ │ ├── DDSendNotice.java
│ │ │ ├── EmailSendNotice.java
│ │ │ ├── SMSSendNotice.java
│ │ │ └── SendNotice.java
│ │ │ ├── annotation
│ │ │ └── RequestRepeat.java
│ │ │ ├── bootstrap
│ │ │ ├── JettyLauncher.java
│ │ │ ├── Launcher.java
│ │ │ ├── Startup.java
│ │ │ └── TomcatLauncher.java
│ │ │ ├── controller
│ │ │ ├── AgentController.java
│ │ │ ├── ApiController.java
│ │ │ ├── BaseController.java
│ │ │ ├── ConfigController.java
│ │ │ ├── DashboardController.java
│ │ │ ├── GroupController.java
│ │ │ ├── JobController.java
│ │ │ ├── MonitorController.java
│ │ │ ├── RecordController.java
│ │ │ ├── TerminalController.java
│ │ │ ├── UserController.java
│ │ │ └── VerifyController.java
│ │ │ ├── dao
│ │ │ ├── AgentDao.java
│ │ │ ├── ConfigDao.java
│ │ │ ├── GroupDao.java
│ │ │ ├── JobDao.java
│ │ │ ├── LogDao.java
│ │ │ ├── RecordDao.java
│ │ │ ├── RoleDao.java
│ │ │ ├── TerminalDao.java
│ │ │ ├── UserAgentDao.java
│ │ │ └── UserDao.java
│ │ │ ├── domain
│ │ │ ├── AgentBean.java
│ │ │ ├── AgentGroupBean.java
│ │ │ ├── ConfigBean.java
│ │ │ ├── GroupBean.java
│ │ │ ├── JobAgent.java
│ │ │ ├── JobBean.java
│ │ │ ├── JobDependency.java
│ │ │ ├── JobFlow.java
│ │ │ ├── LogBean.java
│ │ │ ├── RecordBean.java
│ │ │ ├── RecordMessageBean.java
│ │ │ ├── RoleBean.java
│ │ │ ├── TerminalBean.java
│ │ │ ├── UserAgentBean.java
│ │ │ └── UserBean.java
│ │ │ ├── dto
│ │ │ ├── Agent.java
│ │ │ ├── AgentGroup.java
│ │ │ ├── Chart.java
│ │ │ ├── Config.java
│ │ │ ├── Cropper.java
│ │ │ ├── Group.java
│ │ │ ├── Job.java
│ │ │ ├── Log.java
│ │ │ ├── Record.java
│ │ │ ├── Role.java
│ │ │ ├── Status.java
│ │ │ ├── Terminal.java
│ │ │ ├── User.java
│ │ │ └── UserAgent.java
│ │ │ ├── event
│ │ │ ├── AlarmEvent.java
│ │ │ └── AlarmListener.java
│ │ │ ├── handler
│ │ │ ├── ExceptionHandler.java
│ │ │ ├── JobXServlet.java
│ │ │ └── SecurityHandlerInterceptor.java
│ │ │ ├── job
│ │ │ ├── JobXCollector.java
│ │ │ ├── JobXInitializer.java
│ │ │ ├── JobXInvoker.java
│ │ │ └── JobXRegistry.java
│ │ │ ├── service
│ │ │ ├── AgentService.java
│ │ │ ├── ConfigService.java
│ │ │ ├── ExecuteService.java
│ │ │ ├── GroupService.java
│ │ │ ├── JobService.java
│ │ │ ├── LogService.java
│ │ │ ├── NoticeService.java
│ │ │ ├── QuartzExecutor.java
│ │ │ ├── RecordService.java
│ │ │ ├── RoleService.java
│ │ │ ├── SchedulerService.java
│ │ │ ├── TerminalService.java
│ │ │ ├── UserAgentService.java
│ │ │ └── UserService.java
│ │ │ ├── session
│ │ │ ├── HttpSessionFilter.java
│ │ │ ├── HttpSessionStore.java
│ │ │ ├── cached
│ │ │ │ ├── CachedManager.java
│ │ │ │ ├── MemcachedManager.java
│ │ │ │ └── RedisCacheManager.java
│ │ │ └── wrapper
│ │ │ │ ├── HttpServletRequestSessionWrapper.java
│ │ │ │ ├── HttpSessionStoreWrapper.java
│ │ │ │ └── HttpSessionWrapper.java
│ │ │ ├── support
│ │ │ ├── JobXTools.java
│ │ │ ├── SftpMonitor.java
│ │ │ ├── SshUserInfo.java
│ │ │ ├── TerminalClient.java
│ │ │ ├── TerminalClusterProcessor.java
│ │ │ ├── TerminalContext.java
│ │ │ ├── TerminalOneProcessor.java
│ │ │ └── TerminalSession.java
│ │ │ ├── tag
│ │ │ ├── CronTag.java
│ │ │ ├── PageBean.java
│ │ │ └── PagerTag.java
│ │ │ ├── util
│ │ │ ├── PageUtils.java
│ │ │ └── Parser.java
│ │ │ └── websocket
│ │ │ ├── TerminalHandShaker.java
│ │ │ └── TerminalHandler.java
│ ├── resources
│ │ ├── META-INF
│ │ │ └── jobx
│ │ │ │ └── com.jobxhub.server.bootstrap.Launcher
│ │ ├── app-banner.txt
│ │ ├── app-datasource.xml
│ │ ├── app-mvc.xml
│ │ ├── app-place.xml
│ │ ├── app-session-memcached.xml
│ │ ├── app-session-redis.xml
│ │ ├── app-websocket.xml
│ │ ├── config.properties
│ │ ├── log4j.properties
│ │ ├── mapper
│ │ │ ├── AgentDao.xml
│ │ │ ├── ConfigDao.xml
│ │ │ ├── GroupDao.xml
│ │ │ ├── JobDao.xml
│ │ │ ├── LogDao.xml
│ │ │ ├── RecordDao.xml
│ │ │ ├── RoleDao.xml
│ │ │ ├── TerminalDao.xml
│ │ │ ├── UserAgentDao.xml
│ │ │ └── UserDao.xml
│ │ └── sql
│ │ │ ├── V1.1.0-V1.2.0.sql
│ │ │ └── V1.2.0.sql
│ └── webapp
│ │ ├── WEB-INF
│ │ ├── layouts
│ │ │ ├── cron.jsp
│ │ │ ├── decorators.jsp
│ │ │ ├── email.html
│ │ │ ├── menu.jsp
│ │ │ ├── message.jsp
│ │ │ └── resource.jsp
│ │ ├── sitemesh3.xml
│ │ ├── taglib
│ │ │ ├── c-1_0.tld
│ │ │ ├── c.tld
│ │ │ ├── fmt-1_0-rt.tld
│ │ │ ├── fmt-1_0.tld
│ │ │ ├── fmt.tld
│ │ │ ├── fn.tld
│ │ │ └── opencron.tld
│ │ ├── view
│ │ │ ├── agent
│ │ │ │ ├── add.jsp
│ │ │ │ ├── detail.jsp
│ │ │ │ ├── refresh.jsp
│ │ │ │ └── view.jsp
│ │ │ ├── config
│ │ │ │ ├── edit.jsp
│ │ │ │ └── view.jsp
│ │ │ ├── error
│ │ │ │ ├── 404.jsp
│ │ │ │ ├── 500.jsp
│ │ │ │ └── repeat.jsp
│ │ │ ├── group
│ │ │ │ ├── add.jsp
│ │ │ │ ├── edit.jsp
│ │ │ │ └── view.jsp
│ │ │ ├── home
│ │ │ │ ├── index.jsp
│ │ │ │ └── login.jsp
│ │ │ ├── job
│ │ │ │ ├── add.jsp
│ │ │ │ ├── detail.jsp
│ │ │ │ ├── edit.jsp
│ │ │ │ ├── exec.jsp
│ │ │ │ └── view.jsp
│ │ │ ├── monitor
│ │ │ │ └── druid.jsp
│ │ │ ├── notice
│ │ │ │ ├── detail.jsp
│ │ │ │ ├── info.jsp
│ │ │ │ └── view.jsp
│ │ │ ├── record
│ │ │ │ ├── detail.jsp
│ │ │ │ ├── done.jsp
│ │ │ │ ├── refresh.jsp
│ │ │ │ └── running.jsp
│ │ │ ├── terminal
│ │ │ │ ├── console.jsp
│ │ │ │ ├── error.jsp
│ │ │ │ └── view.jsp
│ │ │ └── user
│ │ │ │ ├── add.jsp
│ │ │ │ ├── detail.jsp
│ │ │ │ ├── edit.jsp
│ │ │ │ └── view.jsp
│ │ └── web.xml
│ │ └── static
│ │ ├── css
│ │ ├── animate.css
│ │ ├── animate.min.css
│ │ ├── app.min.css
│ │ ├── bootstrap.css
│ │ ├── calendar.css
│ │ ├── font-awesome-ie7.min.css
│ │ ├── font-awesome.css
│ │ ├── font-material.css
│ │ ├── form.css
│ │ ├── generics.css
│ │ ├── glyphicons.css
│ │ ├── icons.css
│ │ ├── jobx.css
│ │ ├── jobx.term.css
│ │ ├── jquery.mCustomScrollbar.css
│ │ ├── lightbox.css
│ │ ├── loading.css
│ │ ├── morris.css
│ │ ├── prettify.min.css
│ │ ├── style.css
│ │ └── sweetalert.css
│ │ ├── fonts
│ │ ├── fontawesome
│ │ │ ├── FontAwesome.otf
│ │ │ ├── fontawesome-webfont.eot
│ │ │ ├── fontawesome-webfont.svg
│ │ │ ├── fontawesome-webfont.ttf
│ │ │ ├── fontawesome-webfont.woff
│ │ │ └── fontawesome-webfont.woff2
│ │ ├── glyphicons-halflings-regular.eot
│ │ ├── glyphicons-halflings-regular.svg
│ │ ├── glyphicons-halflings-regular.ttf
│ │ ├── glyphicons-halflings-regular.woff
│ │ ├── glyphicons-regular.eot
│ │ ├── glyphicons-regular.svg
│ │ ├── glyphicons-regular.ttf
│ │ ├── glyphicons-regular.woff
│ │ ├── glyphicons-regular.woff2
│ │ ├── icons
│ │ │ ├── icon.svg
│ │ │ ├── icon.ttf
│ │ │ └── icon.woff
│ │ ├── material-design-iconic-font
│ │ │ ├── css
│ │ │ │ └── material-design-iconic-font.min.css
│ │ │ └── fonts
│ │ │ │ ├── Material-Design-Iconic-Font-v=2.2.0.ttf
│ │ │ │ ├── Material-Design-Iconic-Font-v=2.2.0.woff
│ │ │ │ └── Material-Design-Iconic-Font-v=2.2.0.woff2
│ │ ├── material-icons
│ │ │ ├── Material-Design-Iconic-Font.eot
│ │ │ ├── Material-Design-Iconic-Font.svg
│ │ │ ├── Material-Design-Iconic-Font.ttf
│ │ │ └── Material-Design-Iconic-Font.woff
│ │ ├── nunito
│ │ │ ├── nunito-bold-.eot
│ │ │ ├── nunito-bold.eot
│ │ │ ├── nunito-bold.woff
│ │ │ ├── nunito-bold.woff2
│ │ │ ├── nunito-regular-.html
│ │ │ ├── nunito-regular.eot
│ │ │ ├── nunito-regular.woff
│ │ │ ├── nunito-regular.woff2
│ │ │ ├── nunito-semibold-.eot
│ │ │ ├── nunito-semibold.eot
│ │ │ ├── nunito-semibold.woff
│ │ │ └── nunito-semibold.woff2
│ │ └── opan-sans
│ │ │ ├── OpenSans-Light-webfont.eot
│ │ │ ├── OpenSans-Light-webfont.svg
│ │ │ ├── OpenSans-Light-webfont.ttf
│ │ │ ├── OpenSans-Light-webfont.woff
│ │ │ ├── OpenSans-Regular-webfont.eot
│ │ │ ├── OpenSans-Regular-webfont.svg
│ │ │ ├── OpenSans-Regular-webfont.ttf
│ │ │ ├── OpenSans-Regular-webfont.woff
│ │ │ ├── OpenSans-Semibold-webfont.eot
│ │ │ ├── OpenSans-Semibold-webfont.svg
│ │ │ ├── OpenSans-Semibold-webfont.ttf
│ │ │ └── OpenSans-Semibold-webfont.woff
│ │ ├── img
│ │ ├── 500.png
│ │ ├── add.png
│ │ ├── back.jpg
│ │ ├── body
│ │ │ ├── 1.jpg
│ │ │ ├── 10.png
│ │ │ ├── 2.jpg
│ │ │ ├── 3.jpg
│ │ │ ├── 4.jpg
│ │ │ ├── 5.png
│ │ │ ├── 6.png
│ │ │ ├── 7.png
│ │ │ ├── 8.png
│ │ │ ├── 9.png
│ │ │ ├── blue.jpg
│ │ │ ├── chrome.jpg
│ │ │ ├── greenish.jpg
│ │ │ ├── kiwi.jpg
│ │ │ ├── night.jpg
│ │ │ ├── orange.jpg
│ │ │ ├── skin-1.jpg
│ │ │ ├── skin-10.png
│ │ │ ├── skin-2.jpg
│ │ │ ├── skin-3.jpg
│ │ │ ├── skin-4.jpg
│ │ │ ├── skin-5.png
│ │ │ ├── skin-6.png
│ │ │ ├── skin-7.png
│ │ │ ├── skin-8.png
│ │ │ ├── skin-9.png
│ │ │ ├── skin-blue.jpg
│ │ │ ├── skin-chrome.jpg
│ │ │ ├── skin-greenish.jpg
│ │ │ ├── skin-kiwi.jpg
│ │ │ ├── skin-night.jpg
│ │ │ ├── skin-orange.jpg
│ │ │ ├── skin-sky.jpg
│ │ │ ├── skin-violate.jpg
│ │ │ ├── sky.jpg
│ │ │ └── violate.jpg
│ │ ├── browsers
│ │ │ ├── chrome.png
│ │ │ ├── firefox.png
│ │ │ ├── ie.png
│ │ │ ├── opera.png
│ │ │ └── safari.png
│ │ ├── color-picker
│ │ │ ├── alpha.png
│ │ │ ├── hue.png
│ │ │ └── saturation.png
│ │ ├── crontab_ico.png
│ │ ├── dialog_closed.png
│ │ ├── dot_pattern.png
│ │ ├── favicon.ico
│ │ ├── file.png
│ │ ├── folder-close.png
│ │ ├── folder-open.png
│ │ ├── icon-loader.gif
│ │ ├── img-cover.png
│ │ ├── jobx.png
│ │ ├── loadinfo.gif
│ │ ├── opencron.png
│ │ ├── profile-pic.jpg
│ │ ├── quartz_ico.png
│ │ ├── search-sm.png
│ │ ├── search.png
│ │ ├── search@2x.png
│ │ ├── select-bg.png
│ │ ├── sort.png
│ │ ├── terminal.png
│ │ ├── timg.gif
│ │ ├── timg2.gif
│ │ ├── uploading.gif
│ │ └── wechat_qr.jpg
│ │ └── js
│ │ ├── My97DatePicker
│ │ ├── WdatePicker.js
│ │ ├── calendar.js
│ │ ├── lang
│ │ │ ├── en.js
│ │ │ ├── zh-cn.js
│ │ │ └── zh-tw.js
│ │ └── skin
│ │ │ ├── WdatePicker.css
│ │ │ ├── datePicker.png
│ │ │ ├── default
│ │ │ ├── datepicker.css
│ │ │ └── img.gif
│ │ │ └── whyGreen
│ │ │ ├── bg.jpg
│ │ │ ├── datepicker.css
│ │ │ └── img.gif
│ │ ├── autosize.min.js
│ │ ├── bootstrap-select
│ │ ├── bootstrap-select-lang.js
│ │ ├── bootstrap-select.css
│ │ └── bootstrap-select.js
│ │ ├── bootstrap.js
│ │ ├── bowser.min.js
│ │ ├── calendar.min.js
│ │ ├── charts.js
│ │ ├── chosen.min.js
│ │ ├── clipboard.js
│ │ ├── colorpicker.min.js
│ │ ├── cron.js
│ │ ├── cropper
│ │ ├── cropper.css
│ │ ├── cropper.js
│ │ └── cropper.main.css
│ │ ├── dagre-d3
│ │ ├── d3.v4.min.js
│ │ ├── dagre-d3.core.min.js
│ │ └── dagre-d3.min.js
│ │ ├── dashboard.js
│ │ ├── datetimepicker.min.js
│ │ ├── dygraph-combined.js
│ │ ├── easypiechart.js
│ │ ├── echarts.min.js
│ │ ├── fileinput
│ │ ├── css
│ │ │ ├── fileinput.css
│ │ │ └── fileinput.min.css
│ │ ├── img
│ │ │ ├── loading-sm.gif
│ │ │ └── loading.gif
│ │ ├── js
│ │ │ ├── fileinput.js
│ │ │ ├── fileinput.min.js
│ │ │ ├── locales
│ │ │ │ ├── LANG.js
│ │ │ │ ├── ar.js
│ │ │ │ ├── bg.js
│ │ │ │ ├── ca.js
│ │ │ │ ├── cr.js
│ │ │ │ ├── cz.js
│ │ │ │ ├── da.js
│ │ │ │ ├── de.js
│ │ │ │ ├── el.js
│ │ │ │ ├── es.js
│ │ │ │ ├── fa.js
│ │ │ │ ├── fi.js
│ │ │ │ ├── fr.js
│ │ │ │ ├── hu.js
│ │ │ │ ├── id.js
│ │ │ │ ├── it.js
│ │ │ │ ├── ja.js
│ │ │ │ ├── kr.js
│ │ │ │ ├── nl.js
│ │ │ │ ├── pl.js
│ │ │ │ ├── pt-BR.js
│ │ │ │ ├── pt.js
│ │ │ │ ├── ro.js
│ │ │ │ ├── ru.js
│ │ │ │ ├── sk.js
│ │ │ │ ├── sl.js
│ │ │ │ ├── th.js
│ │ │ │ ├── tr.js
│ │ │ │ ├── uk.js
│ │ │ │ ├── vi.js
│ │ │ │ ├── zh-TW.js
│ │ │ │ └── zh.js
│ │ │ └── plugins
│ │ │ │ ├── canvas-to-blob.js
│ │ │ │ ├── canvas-to-blob.min.js
│ │ │ │ ├── purify.js
│ │ │ │ ├── purify.min.js
│ │ │ │ ├── sortable.js
│ │ │ │ └── sortable.min.js
│ │ ├── sass
│ │ │ └── fileinput.scss
│ │ └── themes
│ │ │ ├── fa
│ │ │ └── theme.js
│ │ │ └── gly
│ │ │ └── theme.js
│ │ ├── flot
│ │ ├── curvedLines.js
│ │ ├── jquery.flot.js
│ │ ├── jquery.flot.pie.js
│ │ └── jquery.flot.resize.js
│ │ ├── functions.js
│ │ ├── gauge.js
│ │ ├── highcharts
│ │ ├── gfx
│ │ │ └── vml-radial-gradient.png
│ │ ├── graphics
│ │ │ ├── highslide
│ │ │ │ ├── close.png
│ │ │ │ ├── closeX.png
│ │ │ │ ├── outlines
│ │ │ │ │ └── rounded-white.png
│ │ │ │ ├── resize.gif
│ │ │ │ └── zoomout.cur
│ │ │ ├── meteogram-symbols-30px.png
│ │ │ ├── search.png
│ │ │ ├── skies.jpg
│ │ │ ├── snow.png
│ │ │ └── sun.png
│ │ ├── index.htm
│ │ ├── js
│ │ │ ├── adapters
│ │ │ │ ├── standalone-framework.js
│ │ │ │ └── standalone-framework.src.js
│ │ │ ├── highcharts-3d.js
│ │ │ ├── highcharts-3d.src.js
│ │ │ ├── highcharts-more.js
│ │ │ ├── highcharts-more.src.js
│ │ │ ├── highcharts.js
│ │ │ ├── highcharts.src.js
│ │ │ ├── modules
│ │ │ │ ├── boost.js
│ │ │ │ ├── boost.src.js
│ │ │ │ ├── broken-axis.js
│ │ │ │ ├── broken-axis.src.js
│ │ │ │ ├── canvas-tools.js
│ │ │ │ ├── canvas-tools.src.js
│ │ │ │ ├── data.js
│ │ │ │ ├── data.src.js
│ │ │ │ ├── drilldown.js
│ │ │ │ ├── drilldown.src.js
│ │ │ │ ├── exporting.js
│ │ │ │ ├── exporting.src.js
│ │ │ │ ├── funnel.js
│ │ │ │ ├── funnel.src.js
│ │ │ │ ├── heatmap.js
│ │ │ │ ├── heatmap.src.js
│ │ │ │ ├── no-data-to-display.js
│ │ │ │ ├── no-data-to-display.src.js
│ │ │ │ ├── offline-exporting.js
│ │ │ │ ├── offline-exporting.src.js
│ │ │ │ ├── solid-gauge.js
│ │ │ │ ├── solid-gauge.src.js
│ │ │ │ ├── treemap.js
│ │ │ │ └── treemap.src.js
│ │ │ └── themes
│ │ │ │ ├── dark-blue.js
│ │ │ │ ├── dark-green.js
│ │ │ │ ├── dark-unica.js
│ │ │ │ ├── gray.js
│ │ │ │ ├── grid-light.js
│ │ │ │ ├── grid.js
│ │ │ │ ├── sand-signika.js
│ │ │ │ └── skies.js
│ │ └── readme.txt
│ │ ├── html5
│ │ ├── html5shiv
│ │ │ ├── html5shiv-printshiv.js
│ │ │ ├── html5shiv-printshiv.min.js
│ │ │ ├── html5shiv.js
│ │ │ └── html5shiv.min.js
│ │ ├── json
│ │ │ ├── cycle.js
│ │ │ ├── json2.js
│ │ │ ├── json2.min.js
│ │ │ ├── json5.js
│ │ │ ├── json5.min.js
│ │ │ ├── json_parse.js
│ │ │ └── json_parse_state.js
│ │ └── respond
│ │ │ ├── respond.matchmedia.addListener.min.js
│ │ │ ├── respond.matchmedia.addListener.src.js
│ │ │ ├── respond.min.js
│ │ │ └── respond.src.js
│ │ ├── icheck.js
│ │ ├── input-mask.min.js
│ │ ├── job.validata.js
│ │ ├── jobx.cropper.js
│ │ ├── jobx.js
│ │ ├── jobx.term.js
│ │ ├── jquery-ui.min.js
│ │ ├── jquery.base64.js
│ │ ├── jquery.cookie.js
│ │ ├── jquery.easing.1.3.js
│ │ ├── jquery.floatThead.js
│ │ ├── jquery.js
│ │ ├── jquery.mCustomScrollbar.min.js
│ │ ├── jquery.min.js
│ │ ├── map.js
│ │ ├── md5.js
│ │ ├── morris.min.js
│ │ ├── pirobox.min.js
│ │ ├── prettify.min.js
│ │ ├── raphael.2.1.2-min.js
│ │ ├── scroll.min.js
│ │ ├── select.min.js
│ │ ├── slider.min.js
│ │ ├── socket.io.js
│ │ ├── spinner.min.js
│ │ ├── sweetalert.min.js
│ │ ├── testdevice.js
│ │ ├── toastr
│ │ ├── toastr.css
│ │ └── toastr.js
│ │ ├── toggler.min.js
│ │ ├── xterm
│ │ ├── addons
│ │ │ ├── attach
│ │ │ │ └── attach.js
│ │ │ ├── fit
│ │ │ │ └── fit.js
│ │ │ ├── fullscreen
│ │ │ │ ├── fullscreen.css
│ │ │ │ └── fullscreen.js
│ │ │ ├── linkify
│ │ │ │ └── linkify.js
│ │ │ └── terminado
│ │ │ │ └── terminado.js
│ │ ├── xterm.css
│ │ ├── xterm.js
│ │ └── xterm.js.map
│ │ └── ztree
│ │ ├── css
│ │ ├── awesomeStyle
│ │ │ ├── awesome.css
│ │ │ ├── awesome.less
│ │ │ ├── fa.less
│ │ │ └── img
│ │ │ │ └── loading.gif
│ │ ├── metroStyle
│ │ │ ├── img
│ │ │ │ ├── line_conn.png
│ │ │ │ ├── loading.gif
│ │ │ │ ├── metro.gif
│ │ │ │ └── metro.png
│ │ │ └── metroStyle.css
│ │ └── zTreeStyle
│ │ │ ├── img
│ │ │ ├── diy
│ │ │ │ ├── 1_close.png
│ │ │ │ ├── 1_open.png
│ │ │ │ ├── 2.png
│ │ │ │ ├── 3.png
│ │ │ │ ├── 4.png
│ │ │ │ ├── 5.png
│ │ │ │ ├── 6.png
│ │ │ │ ├── 7.png
│ │ │ │ ├── 8.png
│ │ │ │ └── 9.png
│ │ │ ├── line_conn.gif
│ │ │ ├── loading.gif
│ │ │ ├── zTreeStandard.gif
│ │ │ └── zTreeStandard.png
│ │ │ └── zTreeStyle.css
│ │ ├── jquery.ztree.core.min.js
│ │ ├── jquery.ztree.excheck.min.js
│ │ ├── jquery.ztree.exedit.min.js
│ │ └── jquery.ztree.exhide.min.js
│ └── test
│ ├── HibernateTest.java
│ └── TestDemo.java
└── pom.xml
/.gitattributes:
--------------------------------------------------------------------------------
1 | *.js linguist-language=Java
2 | *.css linguist-language=Java
3 | *.sh linguist-language=Java
4 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | */target
2 | .idea/*
3 | *.iml
4 | .metadata/*
5 | .recommenders/*
6 | */.classpath
7 | */.project
8 | */.settings
9 | */.DS_Store
10 | .idea/
11 | opencron-server/src/main/webapp/upload/
12 | opencron-server/webapp/
13 |
--------------------------------------------------------------------------------
/.mvn/wrapper/maven-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/datavane/jobx/d758185e41887d91af72e2038072e273f196351a/.mvn/wrapper/maven-wrapper.jar
--------------------------------------------------------------------------------
/.mvn/wrapper/maven-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.0/apache-maven-3.5.0-bin.zip
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | ## Make scheduling easier
2 |
--------------------------------------------------------------------------------
/header.txt:
--------------------------------------------------------------------------------
1 |
2 | Copyright (c) 2015 The JobX Project
3 |
4 | Licensed to the Apache Software Foundation (ASF) under one
5 | or more contributor license agreements. See the NOTICE file
6 | distributed with this work for additional information
7 | regarding copyright ownership. The ASF licenses this file
8 | to you under the Apache License, Version 2.0 (the
9 | "License"); you may not use this file except in compliance
10 | with the License. You may obtain a copy of the License at
11 |
12 | http://www.apache.org/licenses/LICENSE-2.0
13 |
14 | Unless required by applicable law or agreed to in writing,
15 | software distributed under the License is distributed on an
16 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | KIND, either express or implied. See the License for the
18 | specific language governing permissions and limitations
19 | under the License.
20 |
21 |
--------------------------------------------------------------------------------
/jobx-agent/assembly.xml:
--------------------------------------------------------------------------------
1 |
4 | * Licensed to the Apache Software Foundation (ASF) under one 5 | * or more contributor license agreements. See the NOTICE file 6 | * distributed with this work for additional information 7 | * regarding copyright ownership. The ASF licenses this file 8 | * to you under the Apache License, Version 2.0 (the 9 | * "License"); you may not use this file except in compliance 10 | * with the License. You may obtain a copy of the License at 11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | package com.jobxhub.agent.process;
23 |
24 | public class ProcessException extends RuntimeException {
25 |
26 | private static final long serialVersionUID = 1;
27 |
28 | private final int exitCode;
29 | private final String logSnippet;
30 |
31 | public ProcessException(final int exitCode, final String logSnippet) {
32 | this.exitCode = exitCode;
33 | this.logSnippet = logSnippet;
34 | }
35 |
36 | public int getExitCode() {
37 | return this.exitCode;
38 | }
39 |
40 | public String getLogSnippet() {
41 | return this.logSnippet;
42 | }
43 |
44 | }
45 |
--------------------------------------------------------------------------------
/jobx-agent/src/main/resources/META-INF/jobx/com.jobxhub.rpc.ServerHandler:
--------------------------------------------------------------------------------
1 | com.jobxhub.agent.service.AgentService
--------------------------------------------------------------------------------
/jobx-agent/src/test/java/com/jobxhub/agent/test/TestDemo.java:
--------------------------------------------------------------------------------
1 | package com.jobxhub.agent.test;
2 |
3 | import com.jobxhub.common.Constants;
4 | import com.jobxhub.common.util.IOUtils;
5 | import com.jobxhub.common.util.collection.HashMap;
6 | import org.junit.Test;
7 |
8 | import java.util.Map;
9 |
10 | public class TestDemo {
11 |
12 | @Test
13 | public void test1() {
14 | System.out.println("ffff>"+IOUtils.FIELD_TERMINATED_BY+"fff");
15 | }
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/jobx-api/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 | * Licensed to the Apache Software Foundation (ASF) under one 5 | * or more contributor license agreements. See the NOTICE file 6 | * distributed with this work for additional information 7 | * regarding copyright ownership. The ASF licenses this file 8 | * to you under the Apache License, Version 2.0 (the 9 | * "License"); you may not use this file except in compliance 10 | * with the License. You may obtain a copy of the License at 11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | *
14 | * Unless required by applicable law or agreed to in writing, 15 | * software distributed under the License is distributed on an 16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | * KIND, either express or implied. See the License for the 18 | * specific language governing permissions and limitations 19 | * under the License. 20 | */ 21 | 22 | package com.jobxhub.common.exception; 23 | 24 | /** 25 | * 参数异常 26 | * 27 | * @author wanghuajie 28 | */ 29 | public class InvalidException extends BasicException { 30 | 31 | private static final long serialVersionUID = 2513495667924595876L; 32 | 33 | public InvalidException() { 34 | super(); 35 | } 36 | 37 | public InvalidException(String msg) { 38 | super(msg); 39 | } 40 | 41 | public InvalidException(Throwable nestedThrowable) { 42 | super(nestedThrowable); 43 | } 44 | 45 | public InvalidException(String msg, Throwable nestedThrowable) { 46 | super(msg, nestedThrowable); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /jobx-common/src/main/java/com/jobxhub/common/exception/ParameterException.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015 The JobX Project 3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one 5 | * or more contributor license agreements. See the NOTICE file 6 | * distributed with this work for additional information 7 | * regarding copyright ownership. The ASF licenses this file 8 | * to you under the Apache License, Version 2.0 (the 9 | * "License"); you may not use this file except in compliance 10 | * with the License. You may obtain a copy of the License at 11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | *
14 | * Unless required by applicable law or agreed to in writing, 15 | * software distributed under the License is distributed on an 16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | * KIND, either express or implied. See the License for the 18 | * specific language governing permissions and limitations 19 | * under the License. 20 | */ 21 | 22 | package com.jobxhub.common.exception; 23 | 24 | /** 25 | * 参数异常 26 | * 27 | * @author wanghuajie 28 | */ 29 | public class ParameterException extends BasicException { 30 | 31 | private static final long serialVersionUID = 2513495667924595876L; 32 | 33 | public ParameterException() { 34 | super(); 35 | } 36 | 37 | public ParameterException(String msg) { 38 | super(msg); 39 | } 40 | 41 | public ParameterException(Throwable nestedThrowable) { 42 | super(nestedThrowable); 43 | } 44 | 45 | public ParameterException(String msg, Throwable nestedThrowable) { 46 | super(msg, nestedThrowable); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /jobx-common/src/main/java/com/jobxhub/common/exception/TimeoutException.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015 The JobX Project 3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one 5 | * or more contributor license agreements. See the NOTICE file 6 | * distributed with this work for additional information 7 | * regarding copyright ownership. The ASF licenses this file 8 | * to you under the Apache License, Version 2.0 (the 9 | * "License"); you may not use this file except in compliance 10 | * with the License. You may obtain a copy of the License at 11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | *
14 | * Unless required by applicable law or agreed to in writing, 15 | * software distributed under the License is distributed on an 16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | * KIND, either express or implied. See the License for the 18 | * specific language governing permissions and limitations 19 | * under the License. 20 | */ 21 | 22 | package com.jobxhub.common.exception; 23 | 24 | import java.io.PrintStream; 25 | import java.io.PrintWriter; 26 | 27 | public class TimeoutException extends BasicException { 28 | public TimeoutException() { 29 | super(); 30 | } 31 | 32 | public TimeoutException(String msg) { 33 | super(msg); 34 | } 35 | 36 | public TimeoutException(Throwable nestedThrowable) { 37 | super(nestedThrowable); 38 | } 39 | 40 | public TimeoutException(String msg, Throwable nestedThrowable) { 41 | super(msg, nestedThrowable); 42 | } 43 | 44 | @Override 45 | public void printStackTrace() { 46 | super.printStackTrace(); 47 | } 48 | 49 | @Override 50 | public void printStackTrace(PrintStream ps) { 51 | super.printStackTrace(ps); 52 | } 53 | 54 | @Override 55 | public void printStackTrace(PrintWriter pw) { 56 | super.printStackTrace(pw); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /jobx-common/src/main/java/com/jobxhub/common/exception/UnknownException.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015 The JobX Project 3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one 5 | * or more contributor license agreements. See the NOTICE file 6 | * distributed with this work for additional information 7 | * regarding copyright ownership. The ASF licenses this file 8 | * to you under the Apache License, Version 2.0 (the 9 | * "License"); you may not use this file except in compliance 10 | * with the License. You may obtain a copy of the License at 11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | *
14 | * Unless required by applicable law or agreed to in writing, 15 | * software distributed under the License is distributed on an 16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | * KIND, either express or implied. See the License for the 18 | * specific language governing permissions and limitations 19 | * under the License. 20 | */ 21 | package com.jobxhub.common.exception; 22 | 23 | /** 24 | * 未知异常 25 | * 26 | * @author wanghuajie 2012.8.23 27 | */ 28 | public class UnknownException extends BasicException { 29 | 30 | private static final long serialVersionUID = 9108301934211924250L; 31 | 32 | public UnknownException() { 33 | super(); 34 | } 35 | 36 | public UnknownException(String msg) { 37 | super(msg); 38 | } 39 | 40 | public UnknownException(Throwable nestedThrowable) { 41 | super(nestedThrowable); 42 | } 43 | 44 | public UnknownException(String msg, Throwable nestedThrowable) { 45 | super(msg, nestedThrowable); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /jobx-common/src/main/java/com/jobxhub/common/ext/ClassMark.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015 The JobX Project 3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one 5 | * or more contributor license agreements. See the NOTICE file 6 | * distributed with this work for additional information 7 | * regarding copyright ownership. The ASF licenses this file 8 | * to you under the Apache License, Version 2.0 (the 9 | * "License"); you may not use this file except in compliance 10 | * with the License. You may obtain a copy of the License at 11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | *
14 | * Unless required by applicable law or agreed to in writing, 15 | * software distributed under the License is distributed on an 16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | * KIND, either express or implied. See the License for the 18 | * specific language governing permissions and limitations 19 | * under the License. 20 | */ 21 | 22 | package com.jobxhub.common.ext; 23 | 24 | import java.lang.annotation.*; 25 | 26 | @Documented 27 | @Retention(RetentionPolicy.RUNTIME) 28 | @Target({ElementType.TYPE}) 29 | public @interface ClassMark { 30 | String value() default ""; 31 | } 32 | -------------------------------------------------------------------------------- /jobx-common/src/main/java/com/jobxhub/common/ext/MethodMark.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015 The JobX Project 3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one 5 | * or more contributor license agreements. See the NOTICE file 6 | * distributed with this work for additional information 7 | * regarding copyright ownership. The ASF licenses this file 8 | * to you under the Apache License, Version 2.0 (the 9 | * "License"); you may not use this file except in compliance 10 | * with the License. You may obtain a copy of the License at 11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | *
14 | * Unless required by applicable law or agreed to in writing, 15 | * software distributed under the License is distributed on an 16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | * KIND, either express or implied. See the License for the 18 | * specific language governing permissions and limitations 19 | * under the License. 20 | */ 21 | 22 | package com.jobxhub.common.ext; 23 | 24 | import java.lang.annotation.*; 25 | 26 | @Documented 27 | @Retention(RetentionPolicy.RUNTIME) 28 | @Target({ElementType.METHOD}) 29 | public @interface MethodMark { 30 | String value() default ""; 31 | } 32 | -------------------------------------------------------------------------------- /jobx-common/src/main/java/com/jobxhub/common/ext/SPI.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015 The JobX Project 3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one 5 | * or more contributor license agreements. See the NOTICE file 6 | * distributed with this work for additional information 7 | * regarding copyright ownership. The ASF licenses this file 8 | * to you under the Apache License, Version 2.0 (the 9 | * "License"); you may not use this file except in compliance 10 | * with the License. You may obtain a copy of the License at 11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | *
14 | * Unless required by applicable law or agreed to in writing, 15 | * software distributed under the License is distributed on an 16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | * KIND, either express or implied. See the License for the 18 | * specific language governing permissions and limitations 19 | * under the License. 20 | */ 21 | package com.jobxhub.common.ext; 22 | 23 | import java.lang.annotation.*; 24 | 25 | 26 | /** 27 | * 十步杀一人 千里不留行 28 | *
29 | * 事了拂衣去 深藏身与名 30 | *
31 | * 扩展点以Key=扩展点实例的全类名的方式在META-INF.jobx里定义
32 | * 默认的扩展点以"扩展点实例的全类名"呈现,不用Key
33 | */
34 | @Documented
35 | @Retention(RetentionPolicy.RUNTIME)
36 | @Target({ElementType.TYPE})
37 | public @interface SPI {
38 |
39 | /**
40 | * 缺省扩展点名。
41 | */
42 | String value() default "";
43 |
44 | }
--------------------------------------------------------------------------------
/jobx-common/src/main/java/com/jobxhub/common/graph/Graph.java:
--------------------------------------------------------------------------------
1 | package com.jobxhub.common.graph;
2 | /**
3 | * @Package org.opencron.common.graph
4 | * @Title: Graph
5 | * @author hitechr
6 | * @date 2018/4/11 13:03
7 | * @version V1.0
8 | */
9 |
10 | import java.util.HashMap;
11 | import java.util.HashSet;
12 | import java.util.Map;
13 | import java.util.Set;
14 |
15 | /**
16 | * @Descriptions:
17 | */
18 | public class Graph {
19 |
20 | /**
21 | * 图中节点的集合
22 | */
23 | public Set
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 |
23 | package com.jobxhub.common.job;
24 |
25 | public enum Action {
26 | PING(0),
27 | PATH(1),
28 | LISTPATH(2),
29 | MONITOR(3),
30 | EXECUTE(4),
31 | PASSWORD(5),
32 | KILL(6),
33 | PROXY(7),
34 | MACID(8),
35 | RESTART(9),
36 | UPLOAD(10);
37 |
38 | private final int value;
39 |
40 | Action(int value) {
41 | this.value = value;
42 | }
43 |
44 | /**
45 | * Get the integer value of this enum value, as defined in the Thrift IDL.
46 | */
47 | public int getValue() {
48 | return value;
49 | }
50 |
51 |
52 | public static Action findByName(String name) {
53 | for (Action action : Action.values()) {
54 | if (action.name().equalsIgnoreCase(name)) {
55 | return action;
56 | }
57 | }
58 | return null;
59 | }
60 |
61 | }
--------------------------------------------------------------------------------
/jobx-common/src/main/java/com/jobxhub/common/job/AgentJob.java:
--------------------------------------------------------------------------------
1 | package com.jobxhub.common.job;
2 |
3 |
4 | public interface AgentJob {
5 |
6 | Response ping(Request request);
7 |
8 | Response path(Request request);
9 |
10 | Response monitor(Request request);
11 |
12 | Response execute(Request request);
13 |
14 | Response password(Request request);
15 |
16 | Response kill(Request request);
17 |
18 | Response proxy(Request request);
19 |
20 | Response guid(Request request);
21 |
22 | void restart(Request request);
23 |
24 | /**
25 | * agent 自动注册...
26 | *
27 | * @return
28 | */
29 | boolean register();
30 | }
31 |
--------------------------------------------------------------------------------
/jobx-common/src/main/java/com/jobxhub/common/job/RecvieMessage.java:
--------------------------------------------------------------------------------
1 | package com.jobxhub.common.job;
2 |
3 | import java.io.Serializable;
4 |
5 | public class RecvieMessage implements Serializable {
6 |
7 | /**
8 | *
9 | */
10 | private static final long serialVersionUID = 6200390330718630934L;
11 |
12 | private short msgType;
13 |
14 | private String data;
15 |
16 | public short getMsgType() {
17 | return msgType;
18 | }
19 |
20 | public void setMsgType(short msgType) {
21 | this.msgType = msgType;
22 | }
23 |
24 | public String getData() {
25 | return data;
26 | }
27 |
28 | public void setData(String data) {
29 | this.data = data;
30 | }
31 |
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/jobx-common/src/main/java/com/jobxhub/common/job/RpcType.java:
--------------------------------------------------------------------------------
1 | package com.jobxhub.common.job;
2 |
3 | /**
4 | * ${DESCRIPTION}
5 | *
6 | * @author Ricky Fung
7 | */
8 | public enum RpcType {
9 |
10 | SYNC("同步RPC调用"), ASYNC("异步RPC调用"), ONE_WAY("单向调用");
11 |
12 | private String desc;
13 |
14 | RpcType(String desc) {
15 | this.desc = desc;
16 | }
17 |
18 | public String getDesc() {
19 | return desc;
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/jobx-common/src/main/java/com/jobxhub/common/job/SecureModel.java:
--------------------------------------------------------------------------------
1 | package com.jobxhub.common.job;
2 |
3 | import java.io.Serializable;
4 |
5 | public class SecureModel implements Serializable{
6 |
7 | /**
8 | *
9 | */
10 | private static final long serialVersionUID = -2108336644101910071L;
11 | /**
12 | * 验证 token
13 | */
14 | private String token ;
15 |
16 | private boolean autoSuccess;
17 |
18 | public String getToken() {
19 | return token;
20 | }
21 | public void setToken(String token) {
22 | this.token = token;
23 | }
24 | public boolean isAutoSuccess() {
25 | return autoSuccess;
26 | }
27 | public void setAutoSuccess(boolean autoSuccess) {
28 | this.autoSuccess = autoSuccess;
29 | }
30 |
31 |
32 | }
33 |
--------------------------------------------------------------------------------
/jobx-common/src/main/java/com/jobxhub/common/serialize/Cleanable.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2015 The JobX Project
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 |
23 | package com.jobxhub.common.serialize;
24 |
25 | public interface Cleanable {
26 |
27 | void cleanup();
28 | }
29 |
--------------------------------------------------------------------------------
/jobx-common/src/main/java/com/jobxhub/common/serialize/ObjectInput.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2015 The JobX Project
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 |
23 | package com.jobxhub.common.serialize;
24 |
25 | import java.io.IOException;
26 | import java.lang.reflect.Type;
27 |
28 | /**
29 | * Object input.
30 | */
31 | public interface ObjectInput extends DataInput {
32 |
33 | /**
34 | * read object.
35 | *
36 | * @return object.
37 | */
38 | Object readObject() throws IOException, ClassNotFoundException;
39 |
40 | /**
41 | * read object.
42 | *
43 | * @param cls object type.
44 | * @return object.
45 | */
46 |
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 |
23 | package com.jobxhub.common.serialize;
24 |
25 | import java.io.IOException;
26 |
27 | /**
28 | * Object output.
29 | */
30 | public interface ObjectOutput extends DataOutput {
31 |
32 | /**
33 | * write object.
34 | *
35 | * @param obj object.
36 | */
37 | void writeObject(Object obj) throws IOException;
38 |
39 | }
--------------------------------------------------------------------------------
/jobx-common/src/main/java/com/jobxhub/common/serialize/Serializer.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2015 The JobX Project
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | package com.jobxhub.common.serialize;
23 |
24 | import com.jobxhub.common.ext.SPI;
25 |
26 | import java.io.IOException;
27 | /**
28 | * Serialization. (SPI, Singleton, ThreadSafe)
29 | */
30 | @SPI
31 | public interface Serializer {
32 |
33 | /**
34 | * get content type id
35 | *
36 | * @return content type id
37 | */
38 | byte getContentTypeId();
39 |
40 | /**
41 | * get content type
42 | *
43 | * @return content type
44 | */
45 | String getContentType();
46 |
47 | /**
48 | * create serializer
49 | *
50 | * @return serializer
51 | * @throws IOException
52 | */
53 | byte[] serialize(Object object) throws IOException;
54 |
55 | /**
56 | * create deserializer
57 | *
58 | * @param bytes
59 | * @return deserializer
60 | * @throws IOException
61 | */
62 |
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 | package com.jobxhub.common.serialize.hessian2;
22 |
23 | import com.caucho.hessian.io.SerializerFactory;
24 |
25 | public class Hessian2SerializerFactory extends SerializerFactory {
26 |
27 | public static final SerializerFactory SERIALIZER_FACTORY = new Hessian2SerializerFactory();
28 |
29 | private Hessian2SerializerFactory() {
30 | }
31 |
32 | @Override
33 | public ClassLoader getClassLoader() {
34 | return Thread.currentThread().getContextClassLoader();
35 | }
36 |
37 | }
38 |
--------------------------------------------------------------------------------
/jobx-common/src/main/java/com/jobxhub/common/serialize/java/CompactedObjectOutputStream.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2015 The JobX Project
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 | package com.jobxhub.common.serialize.java;
22 |
23 | import java.io.IOException;
24 | import java.io.ObjectOutputStream;
25 | import java.io.ObjectStreamClass;
26 | import java.io.OutputStream;
27 |
28 | /**
29 | * Compacted java object output stream.
30 | */
31 | public class CompactedObjectOutputStream extends ObjectOutputStream {
32 | public CompactedObjectOutputStream(OutputStream out) throws IOException {
33 | super(out);
34 | }
35 |
36 | @Override
37 | protected void writeClassDescriptor(ObjectStreamClass desc) throws IOException {
38 | Class> clazz = desc.forClass();
39 | if (clazz.isPrimitive() || clazz.isArray()) {
40 | write(0);
41 | super.writeClassDescriptor(desc);
42 | } else {
43 | write(1);
44 | writeUTF(desc.getName());
45 | }
46 | }
47 | }
--------------------------------------------------------------------------------
/jobx-common/src/main/java/com/jobxhub/common/serialize/kryo/utils/KryoUtils.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2015 The JobX Project
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 |
23 | package com.jobxhub.common.serialize.kryo.utils;
24 |
25 | import com.esotericsoftware.kryo.Kryo;
26 |
27 | /**
28 | * The kryo utils used by dubbo
29 | *
30 | * @since 2.6.0
31 | */
32 | public class KryoUtils {
33 | private static AbstractKryoFactory kryoFactory = new ThreadLocalKryoFactory();
34 |
35 | public static Kryo get() {
36 | return kryoFactory.getKryo();
37 | }
38 |
39 | public static void release(Kryo kryo) {
40 | kryoFactory.returnKryo(kryo);
41 | }
42 |
43 | public static void register(Class> clazz) {
44 | kryoFactory.registerClass(clazz);
45 | }
46 |
47 | public static void setRegistrationRequired(boolean registrationRequired) {
48 | kryoFactory.setRegistrationRequired(registrationRequired);
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/jobx-common/src/main/java/com/jobxhub/common/serialize/kryo/utils/PooledKryoFactory.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2015 The JobX Project
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | package com.jobxhub.common.serialize.kryo.utils;
23 |
24 | import com.esotericsoftware.kryo.Kryo;
25 | import com.esotericsoftware.kryo.pool.KryoPool;
26 |
27 | public class PooledKryoFactory extends AbstractKryoFactory {
28 |
29 | private KryoPool pool;
30 |
31 | public PooledKryoFactory() {
32 | // Build pool with SoftReferences enabled (optional)
33 | pool = new KryoPool.Builder(this).softReferences().build();
34 | }
35 |
36 | @Override
37 | public Kryo getKryo() {
38 | return pool.borrow();
39 | }
40 |
41 | @Override
42 | public void returnKryo(Kryo kryo) {
43 | pool.release(kryo);
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/jobx-common/src/main/java/com/jobxhub/common/serialize/kryo/utils/PrototypeKryoFactory.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2015 The JobX Project
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | package com.jobxhub.common.serialize.kryo.utils;
23 |
24 | import com.esotericsoftware.kryo.Kryo;
25 |
26 | public class PrototypeKryoFactory extends AbstractKryoFactory {
27 |
28 | @Override
29 | public void returnKryo(Kryo kryo) {
30 | // do nothing
31 | }
32 |
33 | public Kryo getKryo() {
34 | return create();
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/jobx-common/src/main/java/com/jobxhub/common/serialize/kryo/utils/ThreadLocalKryoFactory.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2015 The JobX Project
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 | package com.jobxhub.common.serialize.kryo.utils;
22 |
23 | import com.esotericsoftware.kryo.Kryo;
24 |
25 | public class ThreadLocalKryoFactory extends AbstractKryoFactory {
26 |
27 | private final ThreadLocal
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 |
23 | package com.jobxhub.common.serialize.support;
24 |
25 | import java.util.LinkedHashSet;
26 | import java.util.Set;
27 |
28 | public abstract class SerializableClassRegistry {
29 |
30 | private static final Set
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | package com.jobxhub.common.util;
23 |
24 | public class Holder
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | package com.jobxhub.common.util;
23 |
24 | import java.io.IOException;
25 | import java.util.concurrent.atomic.AtomicInteger;
26 | import java.util.concurrent.atomic.AtomicLong;
27 |
28 | public class IdGenerator {
29 | private static final AtomicLong generator = new AtomicLong(0);
30 |
31 | public static Long getId() {
32 | return generator.incrementAndGet();
33 | }
34 |
35 | public static void main(String[] args) throws IOException {
36 | System.out.println(getId());
37 | System.in.read();
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/jobx-common/src/main/java/com/jobxhub/common/util/NamedThreadFactory.java:
--------------------------------------------------------------------------------
1 | package com.jobxhub.common.util;
2 |
3 |
4 | import java.util.concurrent.ThreadFactory;
5 | import java.util.concurrent.atomic.AtomicInteger;
6 |
7 | public class NamedThreadFactory implements ThreadFactory {
8 | private static final AtomicInteger POOL_SEQ = new AtomicInteger(1);
9 |
10 | private final AtomicInteger mThreadNum = new AtomicInteger(1);
11 |
12 | private final String mPrefix;
13 |
14 | private final boolean mDaemo;
15 |
16 | private final ThreadGroup mGroup;
17 |
18 | public NamedThreadFactory() {
19 | this("pool-" + POOL_SEQ.getAndIncrement(), false);
20 | }
21 |
22 | public NamedThreadFactory(String prefix) {
23 | this(prefix, false);
24 | }
25 |
26 | public NamedThreadFactory(String prefix, boolean daemo) {
27 | mPrefix = prefix + "-thread-";
28 | mDaemo = daemo;
29 | SecurityManager s = System.getSecurityManager();
30 | mGroup = (s == null) ? Thread.currentThread().getThreadGroup() : s.getThreadGroup();
31 | }
32 |
33 | public Thread newThread(Runnable runnable) {
34 | String name = mPrefix + mThreadNum.getAndIncrement();
35 | Thread ret = new Thread(mGroup, runnable, name, 0);
36 | ret.setDaemon(mDaemo);
37 | return ret;
38 | }
39 |
40 | public ThreadGroup getThreadGroup() {
41 | return mGroup;
42 | }
43 | }
--------------------------------------------------------------------------------
/jobx-common/src/main/java/com/jobxhub/common/util/internal/UnsafeIntegerFieldUpdater.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2015 The JobX Project
3 | *
4 | * Licensed under the Apache License, version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at:
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.jobxhub.common.util.internal;
18 |
19 | import sun.misc.Unsafe;
20 |
21 | import java.lang.reflect.Field;
22 |
23 | public class UnsafeIntegerFieldUpdater {
24 | private final long offset;
25 | private final Unsafe unsafe;
26 |
27 | UnsafeIntegerFieldUpdater(Unsafe unsafe, Class super U> tClass, String fieldName) throws NoSuchFieldException {
28 | Field field = tClass.getDeclaredField(fieldName);
29 | if (unsafe == null) {
30 | throw new NullPointerException("unsafe");
31 | }
32 | this.unsafe = unsafe;
33 | offset = unsafe.objectFieldOffset(field);
34 | }
35 |
36 | public void set(U obj, int newValue) {
37 | unsafe.putInt(obj, offset, newValue);
38 | }
39 |
40 | public int get(U obj) {
41 | return unsafe.getInt(obj, offset);
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/jobx-common/src/main/java/com/jobxhub/common/util/internal/UnsafeLongFieldUpdater.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2015 The JobX Project
3 | *
4 | * Licensed under the Apache License, version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at:
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.jobxhub.common.util.internal;
18 |
19 | import sun.misc.Unsafe;
20 |
21 | import java.lang.reflect.Field;
22 |
23 | public class UnsafeLongFieldUpdater {
24 | private final long offset;
25 | private final Unsafe unsafe;
26 |
27 | UnsafeLongFieldUpdater(Unsafe unsafe, Class super U> tClass, String fieldName) throws NoSuchFieldException {
28 | Field field = tClass.getDeclaredField(fieldName);
29 | if (unsafe == null) {
30 | throw new NullPointerException("unsafe");
31 | }
32 | this.unsafe = unsafe;
33 | offset = unsafe.objectFieldOffset(field);
34 | }
35 |
36 | public void set(U obj, long newValue) {
37 | unsafe.putLong(obj, offset, newValue);
38 | }
39 |
40 | public long get(U obj) {
41 | return unsafe.getLong(obj, offset);
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/jobx-common/src/main/resources/META-INF/jobx/com.jobxhub.common.serialize.Serializer:
--------------------------------------------------------------------------------
1 | fastjson=com.jobxhub.common.serialize.fastjson.FastJsonSerializer
2 | fst=com.jobxhub.common.serialize.fst.FstSerializer
3 | hessian2=com.jobxhub.common.serialize.hessian2.Hessian2Serializer
4 | kryo=com.jobxhub.common.serialize.kryo.KryoSerializer
5 | java=com.jobxhub.common.serialize.java.JavaSerializer
6 | nativejava=com.jobxhub.common.serialize.nativejava.NativeJavaSerializer
7 |
8 | #default Serializer
9 | com.jobxhub.common.serialize.kryo.KryoSerializer
--------------------------------------------------------------------------------
/jobx-common/src/test/java/SPITest.java:
--------------------------------------------------------------------------------
1 | import com.jobxhub.common.util.collection.HashMap;
2 | import org.junit.Test;
3 |
4 | import java.util.Map;
5 |
6 |
7 | public class SPITest {
8 |
9 | @Test
10 | public void testInstance() {
11 |
12 | String execUser = "hadoop , hdfs , hfdsaf,88";
13 | System.out.println(execUser.replaceAll("\\s+,\\s+",","));
14 |
15 | }
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/jobx-common/src/test/java/SyncTest.java:
--------------------------------------------------------------------------------
1 |
2 | import org.apache.commons.exec.*;
3 |
4 | import java.util.Timer;
5 | import java.util.TimerTask;
6 |
7 |
8 | /**
9 | * Created by benjobs on 2016/9/10.
10 | */
11 | public class SyncTest {
12 |
13 |
14 | public static void main(String[] args) throws Exception {
15 |
16 | final CommandLine cmdLine = CommandLine.parse("C:\\Developer\\workspace\\bat\\hello.bat");
17 | final ExecuteWatchdog watchdog = new ExecuteWatchdog(Integer.MAX_VALUE);
18 |
19 | final Timer timer = new Timer();
20 |
21 | final DefaultExecuteResultHandler resultHandler = new DefaultExecuteResultHandler() {
22 | @Override
23 | public void onProcessComplete(int exitValue) {
24 | super.onProcessComplete(exitValue);
25 | watchdog.stop();
26 | timer.cancel();
27 | }
28 |
29 | @Override
30 | public void onProcessFailed(ExecuteException e) {
31 | super.onProcessFailed(e);
32 | watchdog.stop();
33 | timer.cancel();
34 | }
35 | };
36 |
37 | DefaultExecutor executor = new DefaultExecutor();
38 |
39 | executor.setWatchdog(watchdog);
40 |
41 | timer.schedule(new TimerTask() {
42 | @Override
43 | public void run() {
44 | //超时,kill...
45 | if (watchdog.isWatching()) {
46 | watchdog.stop();
47 | System.out.println(watchdog.isWatching());
48 | timer.cancel();
49 | System.out.println("kill....");
50 | }
51 | }
52 | }, 5 * 1000);
53 |
54 | executor.execute(cmdLine, resultHandler);
55 | System.out.println("dog is running?" + watchdog.isWatching());
56 |
57 | }
58 |
59 |
60 | }
61 |
--------------------------------------------------------------------------------
/jobx-examples/example-hadoop/pom.xml:
--------------------------------------------------------------------------------
1 |
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 | package com.jobxhub.registry.api;
22 |
23 |
24 | import com.jobxhub.registry.URL;
25 |
26 | import java.util.List;
27 |
28 | /**
29 | * @author benjobs
30 | */
31 | public interface NotifyListener {
32 |
33 | /**
34 | * 当收到服务变更通知时触发。
35 | */
36 | void notify(List
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 | package com.jobxhub.registry.api;
22 |
23 | /**
24 | * @author benjobs
25 | */
26 |
27 | import com.jobxhub.registry.zookeeper.ZookeeperClient;
28 |
29 | /**
30 | * @author benjobs
31 | */
32 | public interface Registry {
33 |
34 | boolean isAvailable();
35 |
36 | void recover() throws Exception;
37 |
38 | void destroy();
39 | /**
40 | * 注册数据
41 | */
42 | void register(String path, boolean ephemeral);
43 |
44 | /**
45 | * 取消注册.
46 | */
47 | void unRegister(String path);
48 |
49 | ZookeeperClient getClient();
50 | }
--------------------------------------------------------------------------------
/jobx-registry/src/main/java/com/jobxhub/registry/zookeeper/ChildListener.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2015 The JobX Project
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | package com.jobxhub.registry.zookeeper;
23 |
24 | import java.util.List;
25 |
26 | public interface ChildListener {
27 |
28 | void childChanged(String path, List
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | package com.jobxhub.registry.zookeeper;
23 |
24 | public interface StateListener {
25 |
26 | int DISCONNECTED = 0;
27 |
28 | int CONNECTED = 1;
29 |
30 | int RECONNECTED = 2;
31 |
32 | void stateChanged(int connected);
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/jobx-registry/src/main/java/com/jobxhub/registry/zookeeper/ZookeeperClient.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2015 The JobX Project
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | package com.jobxhub.registry.zookeeper;
23 |
24 |
25 | import com.jobxhub.common.ext.SPI;
26 |
27 | import java.util.List;
28 |
29 | @SPI
30 | public interface ZookeeperClient {
31 |
32 | void create(String path, boolean ephemeral);
33 |
34 | void delete(String path);
35 |
36 | List
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | package com.jobxhub.registry.zookeeper;
23 |
24 |
25 | import com.jobxhub.common.ext.SPI;
26 | import com.jobxhub.registry.URL;
27 |
28 | @SPI
29 | public interface ZookeeperTransporter {
30 |
31 | ZookeeperClient connect(URL url);
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/jobx-registry/src/main/java/com/jobxhub/registry/zookeeper/curator/CuratorZookeeperTransporter.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2015 The JobX Project
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 | package com.jobxhub.registry.zookeeper.curator;
22 |
23 | import com.jobxhub.registry.URL;
24 | import com.jobxhub.registry.zookeeper.ZookeeperClient;
25 | import com.jobxhub.registry.zookeeper.ZookeeperTransporter;
26 |
27 | public class CuratorZookeeperTransporter implements ZookeeperTransporter {
28 |
29 | public ZookeeperClient connect(URL url) {
30 | return new CuratorZookeeperClient(url);
31 | }
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/jobx-registry/src/main/java/com/jobxhub/registry/zookeeper/zkclient/ZkclientZookeeperTransporter.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2015 The JobX Project
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 | package com.jobxhub.registry.zookeeper.zkclient;
22 |
23 |
24 | import com.jobxhub.registry.URL;
25 | import com.jobxhub.registry.zookeeper.ZookeeperClient;
26 | import com.jobxhub.registry.zookeeper.ZookeeperTransporter;
27 |
28 | public class ZkclientZookeeperTransporter implements ZookeeperTransporter {
29 |
30 | public ZookeeperClient connect(URL url) {
31 | return new ZkclientZookeeperClient(url);
32 | }
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/jobx-registry/src/main/resources/META-INF/jobx/com.jobxhub.registry.zookeeper.ZookeeperClient:
--------------------------------------------------------------------------------
1 | curator=com.jobxhub.registry.zookeeper.curator.CuratorZookeeperClient
2 | zkclient=com.jobxhub.registry.zookeeper.zkclient.ZkclientZookeeperClient
3 |
4 | #def zkClient
5 | com.jobxhub.registry.zookeeper.zkclient.ZkclientZookeeperClient
--------------------------------------------------------------------------------
/jobx-registry/src/main/resources/META-INF/jobx/com.jobxhub.registry.zookeeper.ZookeeperTransporter:
--------------------------------------------------------------------------------
1 | curator=com.jobxhub.registry.zookeeper.curator.CuratorZookeeperTransporter
2 | zkclient=com.jobxhub.registry.zookeeper.zkclient.ZkclientZookeeperTransporter
3 |
4 | #def zkTransporter
5 | com.jobxhub.registry.zookeeper.zkclient.ZkclientZookeeperTransporter
--------------------------------------------------------------------------------
/jobx-rpc/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 | package com.jobxhub.rpc;
22 |
23 | import com.jobxhub.common.ext.SPI;
24 | import com.jobxhub.common.job.Request;
25 |
26 | @SPI
27 | public interface Client extends Invoker {
28 |
29 | void connect(Request request);
30 |
31 | void disconnect() throws Throwable;
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/jobx-rpc/src/main/java/com/jobxhub/rpc/InvokeCallback.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2015 The JobX Project
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 | package com.jobxhub.rpc;
22 |
23 | import com.jobxhub.common.job.Response;
24 |
25 | /**
26 | * @author benjobs
27 | */
28 | public interface InvokeCallback {
29 |
30 | void done(Response response);
31 |
32 | void caught(Throwable err);
33 |
34 | }
--------------------------------------------------------------------------------
/jobx-rpc/src/main/java/com/jobxhub/rpc/Invoker.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2015 The JobX Project
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | package com.jobxhub.rpc;
23 |
24 | import com.jobxhub.common.job.Request;
25 | import com.jobxhub.common.job.Response;
26 |
27 | /**
28 | * @author benjobs
29 | */
30 | public interface Invoker {
31 |
32 | /**
33 | * 同步阻塞调用
34 | * @param request
35 | * @return
36 | * @throws Exception
37 | */
38 | Response sentSync(Request request) throws Exception;
39 |
40 | /**
41 | * 单向调用
42 | * @param request
43 | * @throws Exception
44 | */
45 | void sentOneWay(Request request) throws Exception;
46 |
47 | /**
48 | * 异步非阻塞,通知回调方式调用
49 | * @param request
50 | * @param callback
51 | * @throws Exception
52 | */
53 | void sentAsync(Request request, InvokeCallback callback) throws Exception;
54 |
55 | }
56 |
--------------------------------------------------------------------------------
/jobx-rpc/src/main/java/com/jobxhub/rpc/Server.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2015 The JobX Project
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 | package com.jobxhub.rpc;
22 |
23 |
24 | import com.jobxhub.common.ext.SPI;
25 |
26 | @SPI
27 | public interface Server {
28 |
29 | void start(int port, ServerHandler handler);
30 |
31 | void destroy() throws Throwable;
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/jobx-rpc/src/main/java/com/jobxhub/rpc/ServerHandler.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2015 The JobX Project
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | package com.jobxhub.rpc;
23 |
24 | import com.jobxhub.common.ext.SPI;
25 | import com.jobxhub.common.job.Request;
26 | import com.jobxhub.common.job.Response;
27 |
28 | @SPI
29 | public interface ServerHandler {
30 |
31 | Response handle(Request request);
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/jobx-rpc/src/main/java/com/jobxhub/rpc/netty/idle/IdleClientHandler.java:
--------------------------------------------------------------------------------
1 | package com.jobxhub.rpc.netty.idle;
2 |
3 | import com.jobxhub.rpc.netty.idle.domain.IdleRequest;
4 | import com.jobxhub.rpc.netty.idle.domain.IdleResponse;
5 | import io.netty.channel.ChannelHandler;
6 | import io.netty.channel.ChannelHandlerContext;
7 | import io.netty.channel.SimpleChannelInboundHandler;
8 | import io.netty.handler.timeout.IdleStateEvent;
9 | import org.slf4j.Logger;
10 | import org.slf4j.LoggerFactory;
11 |
12 | import java.util.Date;
13 |
14 | /**
15 | * @author Autorun
16 | */
17 | @ChannelHandler.Sharable
18 | public class IdleClientHandler extends SimpleChannelInboundHandler
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing,
15 | * software distributed under the License is distributed on an
16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 | * KIND, either express or implied. See the License for the
18 | * specific language governing permissions and limitations
19 | * under the License.
20 | */
21 |
22 | package com.jobxhub.rpc.support;
23 |
24 | public interface ChannelWrapper {
25 | boolean isActive();
26 | void close();
27 | }
28 |
--------------------------------------------------------------------------------
/jobx-rpc/src/main/resources/META-INF/jobx/com.jobxhub.rpc.Client:
--------------------------------------------------------------------------------
1 | netty=com.jobxhub.rpc.netty.NettyClient
2 | mina=com.jobxhub.rpc.mina.MinaClient
3 |
4 | #default client
5 | com.jobxhub.rpc.netty.NettyClient
--------------------------------------------------------------------------------
/jobx-rpc/src/main/resources/META-INF/jobx/com.jobxhub.rpc.Server:
--------------------------------------------------------------------------------
1 | netty=com.jobxhub.rpc.netty.NettyServer
2 | mina=com.jobxhub.rpc.mina.MinaServer
3 |
4 | #default NettyServer
5 | com.jobxhub.rpc.netty.NettyServer
6 |
--------------------------------------------------------------------------------
/jobx-rpc/src/test/java/NettyFileTest.java:
--------------------------------------------------------------------------------
1 | import org.junit.Test;
2 | import com.jobxhub.common.ext.ExtensionLoader;
3 | import com.jobxhub.common.job.*;
4 | import com.jobxhub.common.util.IdGenerator;
5 | import com.jobxhub.rpc.Client;
6 | import com.jobxhub.rpc.Server;
7 |
8 | import java.io.File;
9 |
10 | public class NettyFileTest {
11 |
12 |
13 | @Test
14 | public void server() {
15 | Server server = ExtensionLoader.load(Server.class);
16 | server.start(8089, null);
17 | }
18 |
19 | @Test
20 | public void client() throws Exception {
21 | Client client = ExtensionLoader.load(Client.class);
22 | Request request = new Request();
23 | request.setId(IdGenerator.getId());
24 | request.setAction(Action.UPLOAD);
25 | request.setRpcType(RpcType.SYNC);
26 | request.setHost("127.0.0.1");
27 | request.setPort(8089);
28 | File file = new File("/Users/benjobs/movie/盗梦空间.mkv");
29 | RequestFile requestFile = new RequestFile(file);
30 | requestFile.setSavePath("/Users/benjobs/Desktop");
31 | request.setUploadFile(requestFile);
32 | Response response = client.sentSync(request);
33 | System.out.println(response.getAction());
34 |
35 | }
36 |
37 | }
38 |
--------------------------------------------------------------------------------
/jobx-rpc/src/test/java/SPITest.java:
--------------------------------------------------------------------------------
1 | import org.junit.Test;
2 | import com.jobxhub.common.util.SystemPropertyUtils;
3 |
4 | import java.io.IOException;
5 |
6 | public class SPITest {
7 |
8 | @Test
9 | public void testSpi() throws IOException {
10 | boolean xx = SystemPropertyUtils.getBoolean("aaa",false);
11 |
12 | System.out.println(xx);
13 | //SystemPropertyUtils.setProperty("aaa","true");
14 |
15 |
16 | xx = SystemPropertyUtils.getBoolean("aaa",false);
17 |
18 | System.out.println(xx);
19 | }
20 |
21 | }
22 |
--------------------------------------------------------------------------------
/jobx-server/src/main/java/com/jobxhub/server/alarm/AlarmNoticeFacory.java:
--------------------------------------------------------------------------------
1 | package com.jobxhub.server.alarm;
2 | /**
3 | * @Package com.jobxhub.server.alarm
4 | * @Title: AlarmNoticeFacory
5 | * @author hitechr
6 | * @date 2018/6/12 17:21
7 | * @version V1.0
8 | */
9 |
10 | import com.jobxhub.common.job.Alarm;
11 |
12 | import java.util.Map;
13 |
14 | /**
15 | * @Descriptions:
16 | */
17 | public class AlarmNoticeFacory {
18 |
19 | static Map