Skip to content

Commit 9375ea0

Browse files
committed
Add Void class for AsyncMethod to indicate void return
1 parent e78ccf1 commit 9375ea0

3 files changed

Lines changed: 29 additions & 1 deletion

File tree

framework/ipc/src/org/apache/cloudstack/framework/messaging/AsyncCallbackDispatcher.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import java.util.HashMap;
2525
import java.util.Map;
2626

27+
@SuppressWarnings("rawtypes")
2728
public class AsyncCallbackDispatcher implements AsyncCompletionCallback {
2829
private static Map<Class<?>, Method> s_handlerCache = new HashMap<Class<?>, Method>();
2930

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
package org.apache.cloudstack.framework.messaging;
20+
21+
/**
22+
* This is place-holder class to help AsyncMethod to indicate void return value
23+
* public void AsyncMethod(Object realParam, AsyncCompletionCallback<Void> callback) {
24+
*
25+
*/
26+
public class Void {
27+
}

framework/ipc/test/org/apache/cloudstack/framework/messaging/AsyncSampleCallee.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
public class AsyncSampleCallee {
2222
AsyncSampleCallee _driver;
2323

24-
public <T> void createVolume(Object realParam, AsyncCompletionCallback<TestVolume> callback) {
24+
public void createVolume(Object realParam, AsyncCompletionCallback<TestVolume> callback) {
2525

2626
// async executed logic
2727
{

0 commit comments

Comments
 (0)