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; //ww w . j a v a2 s . c om import android.os.*; import org.devtcg.sqliteserver.impl.binder.*; public class AcquireCommand { private static final String KEY_SERVER_BINDER = "server_binder"; public static final class AcquireMessage extends AbstractCommandMessage { private BinderHandle mServerHandle; public AcquireMessage(ClientTransactor transactor) { super(transactor, MethodName.ACQUIRE); } @Override protected Bundle onBuildRequest(Bundle request) { // AbstractCommandMessage already handles putting the client handle on // the request... return request; } @Override protected void onParseResponse(Bundle response) throws SQLiteServerProtocolException { mServerHandle = BundleUtils.getParcelableOrThrow(response, KEY_SERVER_BINDER); } public BinderHandle getServerHandle() { return mServerHandle; } } public static final class AcquireHandler extends AbstractCommandHandler { public AcquireHandler(ServerImpl serverImpl) { super(serverImpl); } @Override protected Bundle onHandle(Bundle request) throws SQLiteServerProtocolException { try { getServerImpl().initServerState(getClientHandle()); } catch (RemoteException e) { // Hehe, technically this is a protocol exception :) throw new SQLiteServerProtocolException("Client is not supposed to die", e); } Bundle ret = new Bundle(); ret.putParcelable(KEY_SERVER_BINDER, new BinderHandle()); return ret; } } }