Back to project page android-sqlite-server.
The source code is released under:
Apache License
If you think the Android project android-sqlite-server listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package org.devtcg.sqliteserver.impl.binder.protocol; /*from w ww . jav a 2 s . c o m*/ import android.os.Bundle; import org.devtcg.sqliteserver.impl.SQLiteExecutor; import org.devtcg.sqliteserver.impl.binder.*; /** * Server representation of the RPC call. Implements the call and formats a response * for the client. */ public abstract class AbstractCommandHandler { private final ServerImpl mServerImpl; private BinderHandle mClientHandle; public AbstractCommandHandler(ServerImpl serverImpl) { mServerImpl = serverImpl; } protected final ServerImpl getServerImpl() { return mServerImpl; } protected final ServerState getServerState() { return mServerImpl.getServerState(mClientHandle); } final BinderHandle getClientHandle() { return mClientHandle; } protected final SQLiteExecutor getExecutor() { return mServerImpl.getExecutor(); } public Bundle handle(Bundle request) throws SQLiteServerProtocolException { mClientHandle = BundleUtils.getParcelableOrThrow(request, AbstractCommandMessage.KEY_CLIENT_BINDER); // TODO: handle exceptions! Bundle result = onHandle(request); if (result == null) { return new Bundle(); } else { return result; } } protected abstract Bundle onHandle(Bundle request) throws SQLiteServerProtocolException; }