Porting Coldfusion Event Gateway to Lucee


#1

I am trying to port the project https://github.com/nmische/cf-redis-sub-gateway to Lucee. I am having a difficult time because I am not a Java developer. Right now I am just trying to get Lucee to pick up the file and then start adding to the file as I go. So far what I have is:

package com.example.redisgateway;
import redis.clients.jedis.JedisPubSub;
import redis.clients.jedis.Jedis;

import java.io.IOException;
import java.util.Map;

import lucee.runtime.gateway.Gateway;
import lucee.runtime.gateway.GatewayEngine;
import lucee.runtime.gateway.GatewayException;

public class RedisSubGateway extends JedisPubSub implements Gateway {
	
	private GatewayEngine engine;
	
	private String id;
	
	protected int state = STOPPED;
	protected String config;
	private String cfcPath;
	
	@Override
	public void init(GatewayEngine engine, String id, String cfcPath, Map<String, String> config) throws GatewayException {
		this.engine = engine;
		this.cfcPath = cfcPath;
		this.id = id;
	}

	@Override
	public void doRestart() {
		doStop();
		doStart();
		
	}

	@Override
	public void doStart() {
		state = STARTING;
		
	}

	@Override
	public void doStop() {
		state = STOPPING;
		
	}

	@Override
	public Object getHelper() {
		return null;
	}

	@Override
	public String getId() {
		return id;
	}

	@Override
	public int getState() {
		return state;
	}

	@Override
	public String sendMessage(Map<?, ?> arg0) throws IOException {
		// TODO Auto-generated method stub
		return null;
	}


}

The problem I am facing is that when I try to create the Event Gateway I get the error:

cannot load class through its string name, because no definition for the class with the specified name [com.example.redisgateway.RedisSubGateway] could be found caused by (java.lang.ClassNotFoundException:com.example.redisgateway.RedisSubGateway;java.lang.ClassNotFoundException:com.example.redisgateway.RedisSubGateway not found by lucee.core [64];)

I have copied the JAR file into many different locations and restarted Lucee on every occasion but it doesn’t seem to like it. Inside the Driver CFC I have the getClass method returning ‘com.example.redisgateway.RedisSubGateway’ and the getCFCPath method is returning and empty string. Can someone tell me the exact spot I am supposed to copy the jar file?