mirror of https://github.com/apache/cloudstack.git
fix build
This commit is contained in:
parent
5d1e97e407
commit
ce2120d09d
|
|
@ -91,7 +91,7 @@ public class HypervsiorHostEndPointRpcServer implements HostEndpointRpcServer {
|
|||
@Override
|
||||
public Answer sendCommand(HypervisorHostEndPoint host, Command command) {
|
||||
SendCommandContext<Answer> context = new SendCommandContext<Answer>(null);
|
||||
AsyncCallbackDispatcher<HypervsiorHostEndPointRpcServer> caller = AsyncCallbackDispatcher.create(this);
|
||||
AsyncCallbackDispatcher<HypervsiorHostEndPointRpcServer, Answer> caller = AsyncCallbackDispatcher.create(this);
|
||||
caller.setCallback(caller.getTarget().sendCommandCallback(null, null))
|
||||
.setContext(context);
|
||||
|
||||
|
|
@ -109,7 +109,7 @@ public class HypervsiorHostEndPointRpcServer implements HostEndpointRpcServer {
|
|||
return context.getAnswer();
|
||||
}
|
||||
|
||||
protected Object sendCommandCallback(AsyncCallbackDispatcher<HypervsiorHostEndPointRpcServer> callback, SendCommandContext<Answer> context) {
|
||||
protected Object sendCommandCallback(AsyncCallbackDispatcher<HypervsiorHostEndPointRpcServer, Answer> callback, SendCommandContext<Answer> context) {
|
||||
context.setAnswer((Answer)callback.getResult());
|
||||
synchronized(context) {
|
||||
context.notify();
|
||||
|
|
|
|||
|
|
@ -204,7 +204,7 @@ public class VolumeEntityImpl implements VolumeEntity {
|
|||
public boolean createVolumeFromTemplate(long dataStoreId, VolumeDiskType diskType, TemplateEntity template) {
|
||||
TemplateInfo ti = ((TemplateEntityImpl)template).getTemplateInfo();
|
||||
|
||||
AsyncCallbackDispatcher<VolumeEntityImpl> caller = AsyncCallbackDispatcher.create(this);
|
||||
AsyncCallbackDispatcher<VolumeEntityImpl, VolumeInfo> caller = AsyncCallbackDispatcher.create(this);
|
||||
caller.setCallback(caller.getTarget().createVolumeFromTemplateAsyncCallback(null, null));
|
||||
|
||||
vs.createVolumeFromTemplateAsync(volumeInfo, dataStoreId, diskType, ti, caller);
|
||||
|
|
@ -219,7 +219,7 @@ public class VolumeEntityImpl implements VolumeEntity {
|
|||
}
|
||||
|
||||
|
||||
private Void createVolumeFromTemplateAsyncCallback(AsyncCompletionCallback<VolumeInfo> callback, Object context) {
|
||||
private Void createVolumeFromTemplateAsyncCallback(AsyncCallbackDispatcher<VolumeEntityImpl, VolumeInfo> callback, Object context) {
|
||||
synchronized (volumeInfo) {
|
||||
volumeInfo.notify();
|
||||
}
|
||||
|
|
@ -228,7 +228,7 @@ public class VolumeEntityImpl implements VolumeEntity {
|
|||
|
||||
@Override
|
||||
public boolean createVolume(long dataStoreId, VolumeDiskType diskType) {
|
||||
AsyncCallbackDispatcher<VolumeEntityImpl> caller = AsyncCallbackDispatcher.create(this);
|
||||
AsyncCallbackDispatcher<VolumeEntityImpl, VolumeApiResult> caller = AsyncCallbackDispatcher.create(this);
|
||||
caller.setCallback(caller.getTarget().createVolumeCallback(null, null));
|
||||
vs.createVolumeAsync(volumeInfo, dataStoreId, diskType, caller);
|
||||
try {
|
||||
|
|
@ -245,7 +245,7 @@ public class VolumeEntityImpl implements VolumeEntity {
|
|||
}
|
||||
}
|
||||
|
||||
private Void createVolumeCallback(AsyncCallbackDispatcher<VolumeApiResult> callback, Object context) {
|
||||
private Void createVolumeCallback(AsyncCallbackDispatcher<VolumeApiResult, VolumeApiResult> callback, Object context) {
|
||||
synchronized (volumeInfo) {
|
||||
this.result = callback.getResult();
|
||||
volumeInfo.notify();
|
||||
|
|
|
|||
|
|
@ -87,5 +87,5 @@ public interface VolumeService {
|
|||
VolumeEntity getVolumeEntity(long volumeId);
|
||||
|
||||
void createVolumeFromTemplateAsync(VolumeInfo volume, long dataStoreId, VolumeDiskType diskType, TemplateInfo template,
|
||||
AsyncCompletionCallback<VolumeApiResult> callback);
|
||||
AsyncCompletionCallback<VolumeInfo> callback);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -65,14 +65,14 @@ public class DefaultPrimaryDataStoreDriverImpl implements PrimaryDataStoreDriver
|
|||
CreateVolumeCommand createCmd = new CreateVolumeCommand(this.dataStore.getVolumeTO(volInfo));
|
||||
|
||||
CreateVolumeContext<CommandResult> context = new CreateVolumeContext<CommandResult>(callback, vol);
|
||||
AsyncCallbackDispatcher<DefaultPrimaryDataStoreDriverImpl> caller = AsyncCallbackDispatcher.create(this);
|
||||
AsyncCallbackDispatcher<DefaultPrimaryDataStoreDriverImpl, Answer> caller = AsyncCallbackDispatcher.create(this);
|
||||
caller.setContext(context)
|
||||
.setCallback(caller.getTarget().createVolumeAsyncCallback(null, null));
|
||||
|
||||
ep.sendMessageAsync(createCmd, caller);
|
||||
}
|
||||
|
||||
protected Void createVolumeAsyncCallback(AsyncCallbackDispatcher<DefaultPrimaryDataStoreDriverImpl> callback, CreateVolumeContext<CommandResult> context) {
|
||||
protected Void createVolumeAsyncCallback(AsyncCallbackDispatcher<DefaultPrimaryDataStoreDriverImpl, Answer> callback, CreateVolumeContext<CommandResult> context) {
|
||||
CommandResult result = new CommandResult();
|
||||
CreateVolumeAnswer volAnswer = (CreateVolumeAnswer) callback.getResult();
|
||||
if (volAnswer.getResult()) {
|
||||
|
|
@ -156,7 +156,7 @@ public class DefaultPrimaryDataStoreDriverImpl implements PrimaryDataStoreDriver
|
|||
EndPoint ep = endPoints.get(0);
|
||||
|
||||
CreateVolumeFromBaseImageContext<CommandResult> context = new CreateVolumeFromBaseImageContext<CommandResult>(callback, volume);
|
||||
AsyncCallbackDispatcher<DefaultPrimaryDataStoreDriverImpl> caller = AsyncCallbackDispatcher.create(this);
|
||||
AsyncCallbackDispatcher<DefaultPrimaryDataStoreDriverImpl, Answer> caller = AsyncCallbackDispatcher.create(this);
|
||||
caller.setContext(context)
|
||||
.setCallback(caller.getTarget().createVolumeFromBaseImageAsyncCallback(null, null));
|
||||
|
||||
|
|
@ -165,7 +165,7 @@ public class DefaultPrimaryDataStoreDriverImpl implements PrimaryDataStoreDriver
|
|||
|
||||
}
|
||||
|
||||
public Object createVolumeFromBaseImageAsyncCallback(AsyncCallbackDispatcher<DefaultPrimaryDataStoreDriverImpl> callback, CreateVolumeFromBaseImageContext<CommandResult> context) {
|
||||
public Object createVolumeFromBaseImageAsyncCallback(AsyncCallbackDispatcher<DefaultPrimaryDataStoreDriverImpl, Answer> callback, CreateVolumeFromBaseImageContext<CommandResult> context) {
|
||||
CreateVolumeAnswer answer = (CreateVolumeAnswer)callback.getResult();
|
||||
CommandResult result = new CommandResult();
|
||||
if (answer == null || answer.getDetails() != null) {
|
||||
|
|
|
|||
|
|
@ -91,14 +91,14 @@ public class VolumeServiceImpl implements VolumeService {
|
|||
vo.stateTransit(Volume.Event.CreateRequested);
|
||||
|
||||
CreateVolumeContext<VolumeApiResult> context = new CreateVolumeContext<VolumeApiResult>(callback, vo);
|
||||
AsyncCallbackDispatcher<VolumeServiceImpl> caller = AsyncCallbackDispatcher.create(this);
|
||||
AsyncCallbackDispatcher<VolumeServiceImpl, CommandResult> caller = AsyncCallbackDispatcher.create(this);
|
||||
caller.setCallback(caller.getTarget().createVolumeCallback(null, null))
|
||||
.setContext(context);
|
||||
|
||||
dataStore.createVolumeAsync(vo, diskType, caller);
|
||||
}
|
||||
|
||||
protected Void createVolumeCallback(AsyncCallbackDispatcher<VolumeServiceImpl> callback, CreateVolumeContext<VolumeApiResult> context) {
|
||||
protected Void createVolumeCallback(AsyncCallbackDispatcher<VolumeServiceImpl, CommandResult> callback, CreateVolumeContext<VolumeApiResult> context) {
|
||||
CommandResult result = callback.getResult();
|
||||
VolumeObject vo = context.getVolume();
|
||||
VolumeApiResult volResult = new VolumeApiResult(vo);
|
||||
|
|
|
|||
|
|
@ -11,12 +11,6 @@ import org.apache.cloudstack.storage.volume.VolumeObject;
|
|||
|
||||
public class SolidfirePrimaryDataStoreDriver implements PrimaryDataStoreDriver {
|
||||
|
||||
@Override
|
||||
public boolean createVolumeAsync(VolumeObject vol) {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean deleteVolume(VolumeObject vo) {
|
||||
// TODO Auto-generated method stub
|
||||
|
|
@ -77,4 +71,10 @@ public class SolidfirePrimaryDataStoreDriver implements PrimaryDataStoreDriver {
|
|||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createVolumeAsync(VolumeObject vol, AsyncCompletionCallback<CommandResult> callback) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue