// Path: src/main/java/com/amebame/triton/server/TritonServerContext.java
// @Singleton
// public class TritonServerContext {
// 	
// 	private TritonServerMethodMap methodMap;
// 	
// 	@Inject
// 	public TritonServerContext(TritonServerConfiguration config) {
// 		methodMap = new TritonServerMethodMap();
// 	}
// 	
// 	/**
// 	 * Add server methods from the target object
// 	 * @param target
// 	 */
// 	public void addServerMethod(Object target) {
// 		methodMap.register(target);
// 	}
// 	
// 	/**
// 	 * Get server method by name
// 	 * @param name
// 	 * @return
// 	 */
// 	public TritonServerMethod getServerMethod(String name) {
// 		return methodMap.getMethod(name);
// 	}
// }
// 
// Path: src/main/java/com/amebame/triton/service/TritonScheduler.java
// @Singleton
// public class TritonScheduler {
// 	
// 	private ScheduledExecutorService executor;
// 
// 	public TritonScheduler() {
// 		executor = Executors.newSingleThreadScheduledExecutor(new NamedThreadFactory("triton-scheduler-"));
// 	}
// 
// 	/**
// 	 * Schedule once with delay
// 	 * @param command
// 	 * @param delay
// 	 */
// 	public void schedule(Runnable command, long delay) {
// 		executor.schedule(command, delay, TimeUnit.MILLISECONDS);
// 	}
// 	
// 	/**
// 	 * Schedule task at fixed rate
// 	 * @param command
// 	 * @param delay
// 	 * @param period
// 	 */
// 	public void scheduleAtFixedRate(Runnable command, long delay, long period) {
// 		executor.scheduleAtFixedRate(command, delay, period, TimeUnit.MILLISECONDS);
// 	}
// 	
// 	/**
// 	 * Schedule task with fixed delay
// 	 * @param command
// 	 * @param delay
// 	 * @param period
// 	 */
// 	public void scheduleWithFixedDelay(Runnable command, long delay, long period) {
// 		executor.scheduleWithFixedDelay(command, delay, period, TimeUnit.MILLISECONDS);
// 	}
// 	
// }
// 
// Path: src/main/java/com/amebame/triton/service/lock/method/LockMethods.java
// public class LockMethods {
// 	
// 	private LockManager manager;
// 
// 	@Inject
// 	public LockMethods(LockManager manager) {
// 		this.manager = manager;
// 	}
// 	
// 	@TritonMethod(value="lock.acquire", async=true)
// 	public void acquire(Channel channel, TritonMessage message, LockAcquire acquire) {
// 		LockOwner owner = new LockOwner(channel, message.getCallId());
// 		manager.lock(owner, acquire.getKey(), acquire.getTimeout());
// 	}
// 	
// 	@TritonMethod("lock.release")
// 	public boolean release(Channel channel, TritonMessage message, LockRelease release) {
// 		LockOwner owner = new LockOwner(channel, message.getCallId(), release.getOwnerId());
// 		manager.unlock(owner, release.getKey());
// 		return true;
// 	}
// 
// }


import javax.inject.Inject;
import com.amebame.triton.server.TritonServerContext;
import com.amebame.triton.service.TritonScheduler;
import com.amebame.triton.service.lock.method.LockMethods;
package com.amebame.triton.service.lock;



public class LockSetup {
	
	@Inject private TritonServerContext context;
	
// Path: src/main/java/com/amebame/triton/server/TritonServerContext.java
// @Singleton
// public class TritonServerContext {
// 	
// 	private TritonServerMethodMap methodMap;
// 	
// 	@Inject
// 	public TritonServerContext(TritonServerConfiguration config) {
// 		methodMap = new TritonServerMethodMap();
// 	}
// 	
// 	/**
// 	 * Add server methods from the target object
// 	 * @param target
// 	 */
// 	public void addServerMethod(Object target) {
// 		methodMap.register(target);
// 	}
// 	
// 	/**
// 	 * Get server method by name
// 	 * @param name
// 	 * @return
// 	 */
// 	public TritonServerMethod getServerMethod(String name) {
// 		return methodMap.getMethod(name);
// 	}
// }
// 
// Path: src/main/java/com/amebame/triton/service/TritonScheduler.java
// @Singleton
// public class TritonScheduler {
// 	
// 	private ScheduledExecutorService executor;
// 
// 	public TritonScheduler() {
// 		executor = Executors.newSingleThreadScheduledExecutor(new NamedThreadFactory("triton-scheduler-"));
// 	}
// 
// 	/**
// 	 * Schedule once with delay
// 	 * @param command
// 	 * @param delay
// 	 */
// 	public void schedule(Runnable command, long delay) {
// 		executor.schedule(command, delay, TimeUnit.MILLISECONDS);
// 	}
// 	
// 	/**
// 	 * Schedule task at fixed rate
// 	 * @param command
// 	 * @param delay
// 	 * @param period
// 	 */
// 	public void scheduleAtFixedRate(Runnable command, long delay, long period) {
// 		executor.scheduleAtFixedRate(command, delay, period, TimeUnit.MILLISECONDS);
// 	}
// 	
// 	/**
// 	 * Schedule task with fixed delay
// 	 * @param command
// 	 * @param delay
// 	 * @param period
// 	 */
// 	public void scheduleWithFixedDelay(Runnable command, long delay, long period) {
// 		executor.scheduleWithFixedDelay(command, delay, period, TimeUnit.MILLISECONDS);
// 	}
// 	
// }
// 
// Path: src/main/java/com/amebame/triton/service/lock/method/LockMethods.java
// public class LockMethods {
// 	
// 	private LockManager manager;
// 
// 	@Inject
// 	public LockMethods(LockManager manager) {
// 		this.manager = manager;
// 	}
// 	
// 	@TritonMethod(value="lock.acquire", async=true)
// 	public void acquire(Channel channel, TritonMessage message, LockAcquire acquire) {
// 		LockOwner owner = new LockOwner(channel, message.getCallId());
// 		manager.lock(owner, acquire.getKey(), acquire.getTimeout());
// 	}
// 	
// 	@TritonMethod("lock.release")
// 	public boolean release(Channel channel, TritonMessage message, LockRelease release) {
// 		LockOwner owner = new LockOwner(channel, message.getCallId(), release.getOwnerId());
// 		manager.unlock(owner, release.getKey());
// 		return true;
// 	}
// 
// }


// Path: src/main/java/com/amebame/triton/service/lock/LockSetup.java
import javax.inject.Inject;
import com.amebame.triton.server.TritonServerContext;
import com.amebame.triton.service.TritonScheduler;
import com.amebame.triton.service.lock.method.LockMethods;

package com.amebame.triton.service.lock;



public class LockSetup {
	
	@Inject private TritonServerContext context;
	
	@Inject private LockMethods methods;