Skip to content

Commit

Permalink
Restore the @OverRide annotations - TESTED
Browse files Browse the repository at this point in the history
  • Loading branch information
Joubin Houshyar committed Oct 6, 2011
1 parent 65d6e0e commit 5c3af5c
Show file tree
Hide file tree
Showing 11 changed files with 37 additions and 45 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ public FaultedConnection (ConnectionSpec connSpec, String errMsg) {
this.errorMsg = errMsg;
this.connSpec = connSpec;
}
// TODO: restore this method of Connection

/* (non-Javadoc) @see org.jredis.connector.Connection#getModality() */
// @Override
// @Override // TODO: restore this method of Connection
public Modality getModality()
{
throw new ClientRuntimeException (errorMsg);
Expand Down Expand Up @@ -84,7 +84,7 @@ final public boolean addListener (Listener connListener) {
throw new NotSupportedException("Events not supported");
}
/* (non-Javadoc) @see org.jredis.connector.Connection#removeListener(org.jredis.connector.Connection.Listener) */
// @Override
@Override
final public boolean removeListener (Listener connListener) {
throw new NotSupportedException("Events not supported");
}
Expand Down
8 changes: 4 additions & 4 deletions core/api/src/main/java/org/jredis/protocol/Response.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ public interface Response extends Message {
*/
public boolean isError ();

// /**
// * @return {@link Response.Type} of this response.
// */
// public Type getType ();
/**
* @return {@link Response.Type} of this response.
*/
public Type getType ();


/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ protected final void setConnection (Connection connection) {
/* (non-Javadoc)
* @see org.jredis.resource.Resource#getInterface()
*/
// @Override
@Override
public JRedis getInterface() {
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,12 @@ protected Connection createSyncConnection(ConnectionSpec connSpec){

private Context context;

// @Override
@Override
public final Context getContext() throws ResourceException {
return context;
}

// @Override
@Override
public final void setContext(Context context) throws ResourceException {
this.context = context;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,12 @@ protected ConnectionBase (ConnectionSpec spec)
*/
// ------------------------------------------------------------------------

// @Override
@Override
public ConnectionSpec getSpec () {
return this.spec;
}

// @Override
@Override
public Response serviceRequest(Command cmd, byte[]... args)
throws RedisException, ClientRuntimeException, ProviderException
{
Expand All @@ -148,7 +148,7 @@ public Response serviceRequest(Command cmd, byte[]... args)
"byte[]...) is not supported.");
}

// @Override
@Override
public Future<Response> queueRequest(Command cmd, byte[]... args)
throws ClientRuntimeException, ProviderException
{
Expand Down Expand Up @@ -203,10 +203,6 @@ protected void initializeComponents () {
}
}

// // TODO: diff this
// protected void cleanup () {
// }

/**
* Extension point -- callback on this method when {@link ConnectionBase} has connected to server.
* <b>It is important to note that the extension must call super.notifyConnected</b> if reliable service (using
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ private final void checkStatus () throws ExecutionException
// ------------------------------------------------------------------------

/* (non-Javadoc) @see java.util.concurrent.Future#get() */
// @Override
@Override
public Response get () throws InterruptedException, ExecutionException {
completion.await();

Expand All @@ -144,7 +144,7 @@ public Response get () throws InterruptedException, ExecutionException {
}

/* (non-Javadoc) @see java.util.concurrent.Future#get(long, java.util.concurrent.TimeUnit) */
// @Override
@Override
public Response get (long timeout, TimeUnit unit)
throws InterruptedException, ExecutionException, TimeoutException
{
Expand All @@ -159,22 +159,21 @@ public Response get (long timeout, TimeUnit unit)
* Pipeline does not support canceling of requests -- will always return false.
* @see java.util.concurrent.Future#cancel(boolean)
*/
// @Override
@Override
public boolean cancel (boolean mayInterruptIfRunning) { return false; }

/**
* Pipeline does not support canceling of requests -- will always return false.
* @see PendingRequest#cancel(boolean)
* @see java.util.concurrent.Future#isCancelled()
*/
// @Override
@Override
public boolean isCancelled () { return false; }


// @Override
/* (non-Javadoc) @see java.util.concurrent.Future#isDone() */
@Override
public boolean isDone () {
// return completion.isSignalled();

return completion.isSignalled();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,6 @@ protected void initializeComponents () {
isActive.set(false);
}

// @Override
// protected void cleanup () {
// super.cleanup();
// respHandlerThread.interrupt();
// }

@Override
protected void notifyConnected () {
super.notifyConnected();
Expand Down Expand Up @@ -304,7 +298,7 @@ public ResponseHandler () {
* means faulted server, specially given the fact that a pipeline has a heartbeat
* so the issue can not be timeout.
*/
// @Override
@Override
public void run () {
thread.compareAndSet(null, Thread.currentThread());
alive_flag.compareAndSet(false, true);
Expand Down Expand Up @@ -402,6 +396,7 @@ final private void shutdownHandler() {
*
* @see org.jredis.connector.Connection.Listener#onEvent(org.jredis.connector.Connection.Event)
*/
@Override
public void onEvent (Event event) {
if(event.getSource() != PipelineConnectionBase.this) {
Log.bug("event source [%s] is not this pipeline [%s]", event.getSource(), PipelineConnectionBase.this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ public SyncConnection (
/* (non-Javadoc)
* @see org.jredis.connector.Connection#getModality()
*/
// TODO: restore this
// @Override
public final Modality getModality() {
return Connection.Modality.Synchronous;
Expand All @@ -101,6 +102,7 @@ public final Modality getModality() {
/* (non-Javadoc)
* @see org.jredis.ri.alphazero.connection.ConnectionBase#serviceRequest(org.jredis.protocol.Command, byte[][])
*/
@Override
public Response serviceRequest (Command cmd, byte[]... args)
throws RedisException
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,22 +48,22 @@ protected final void assertResponseRead () {
// Interface
// ------------------------------------------------------------------------

// @Override
@Override
public boolean didRead() { return didRead; }

// @Override
@Override
public ResponseStatus getStatus() {return status; }

// @Override
@Override
public Type getType() { return type;}

// @Override
@Override
public boolean isError() {
assertResponseRead();
return isError;
}

// @Override
@Override
public void write(OutputStream out) throws ClientRuntimeException, ProviderException {
throw new RuntimeException ("Message.write not implemented! [Apr 10, 2009]");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,19 +50,19 @@ public VirtualResponse (ResponseStatus status) {
this.status = status;
}

// @Override
@Override
public boolean didRead() {return true;}

// @Override
@Override
public ResponseStatus getStatus() { return status;}

// @Override
@Override
public Type getType() { return Type.Status;}

// @Override
@Override
public boolean isError() { return false;}

// @Override
@Override
/**
* The purpose of this class is to provide responses that are not actually read from
* the server. Typically this is for commands that closed the connection on the send, such
Expand All @@ -73,7 +73,7 @@ public VirtualResponse (ResponseStatus status) {
*/
public void read(InputStream in) throws ClientRuntimeException, ProviderException { return;}

// @Override
@Override
public void write(OutputStream out) throws ClientRuntimeException, ProviderException {
throw new RuntimeException ("Streamable.write not implemented! [Apr 4, 2009]");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public DefaultStringCodec(Charset charset){
/* (non-Javadoc)
* @see org.jredis.Codec#decode(byte[])
*/
// @Override
@Override
public String decode (byte[] bytes) {
return new String(bytes);
// return new String(bytes, charSet); // java 1.6
Expand All @@ -44,7 +44,7 @@ public String decode (byte[] bytes) {
/* (non-Javadoc)
* @see org.jredis.Codec#encode(java.lang.Object)
*/
// @Override
@Override
public byte[] encode (String value) {
return value.getBytes();
// return value.getBytes(charSet);
Expand All @@ -53,7 +53,7 @@ public byte[] encode (String value) {
/* (non-Javadoc)
* @see org.jredis.Codec#supports(java.lang.Class)
*/
// @Override
@Override
public boolean supports (Class<?> type) {
return type.equals(String.class) ? true : false;
}
Expand Down

0 comments on commit 5c3af5c

Please sign in to comment.