java: can't use constructors in abstract class
Posted
by ufk
on Stack Overflow
See other posts from Stack Overflow
or by ufk
Published on 2010-05-04T09:53:06Z
Indexed on
2010/05/04
9:58 UTC
Read the original article
Hit count: 312
Hi.
I created the following abstract class for job scheduler in red5:
package com.demogames.jobs;
import com.demogames.demofacebook.MysqlDb;
import org.red5.server.api.IClient;
import org.red5.server.api.IConnection;
import org.red5.server.api.IScope;
import org.red5.server.api.scheduling.IScheduledJob;
import org.red5.server.api.so.ISharedObject;
import org.apache.log4j.Logger;
import org.red5.server.api.Red5;
/**
*
* @author ufk
*/
abstract public class DemoJob implements IScheduledJob {
protected IConnection conn;
protected IClient client;
protected ISharedObject so;
protected IScope scope;
protected MysqlDb mysqldb;
protected static org.apache.log4j.Logger log = Logger
.getLogger(DemoJob.class);
protected DemoJob (ISharedObject so, MysqlDb mysqldb){
this.conn=Red5.getConnectionLocal();
this.client = conn.getClient();
this.so=so;
this.mysqldb=mysqldb;
this.scope=conn.getScope();
}
protected DemoJob(ISharedObject so) {
this.conn=Red5.getConnectionLocal();
this.client=this.conn.getClient();
this.so=so;
this.scope=conn.getScope();
}
protected DemoJob() {
this.conn=Red5.getConnectionLocal();
this.client=this.conn.getClient();
this.scope=conn.getScope();
}
}
Then i created a simple class that extends the previous one:
public class StartChallengeJob extends DemoJob {
public void execute(ISchedulingService service) {
log.error("test");
}
}
The problem is that my main application can only see the constructor without any parameters.
with means i can do new StartChallengeJob()
why doesn't the main application sees all the constructors ?
thanks!
© Stack Overflow or respective owner