use of org.eclipse.ecf.core.util.ECFException in project ecf by eclipse.
the class AbstractRemoteService method getProxy.
/**
* @since 6.0
*/
@SuppressWarnings("unchecked")
public Object getProxy(ClassLoader cl, Class[] interfaces) throws ECFException {
// Now add any async p
List classes = addAsyncProxyClasses(cl, interfaces);
addRemoteServiceProxyToProxy(classes);
// create and return proxy
try {
return createProxy(cl, (Class[]) classes.toArray(new Class[classes.size()]));
} catch (final Exception e) {
// $NON-NLS-1$
ECFException except = new ECFException("Failed to create proxy", e);
// $NON-NLS-1$
logWarning("Exception in remote service getProxy", except);
throw except;
} catch (final NoClassDefFoundError e) {
// $NON-NLS-1$
ECFException except = new ECFException("Failed to load proxy interface class", e);
// $NON-NLS-1$
logWarning("Could not load class for getProxy", except);
throw except;
}
}
use of org.eclipse.ecf.core.util.ECFException in project ecf by eclipse.
the class MSNContainer method sendChatMessage.
public void sendChatMessage(ID toID, String body) throws ECFException {
try {
ChatSession cs = (ChatSession) chatSessions.get(toID);
if (cs == null) {
cs = client.createChatSession(toID.getName());
cs.addChatSessionListener(new ChatSessionListener(toID));
chatSessions.put(toID, cs);
}
cs.sendMessage(body);
} catch (IOException e) {
throw new ECFException(e);
}
}
use of org.eclipse.ecf.core.util.ECFException in project ecf by eclipse.
the class LocalRemoteServiceRegistry method callSynch.
protected Object callSynch(RemoteServiceRegistrationImpl registration, IRemoteCall call) throws ECFException {
try {
Object service = registration.getService();
if (service == null)
// $NON-NLS-1$
throw new NullPointerException("Service is null for registration=" + registration.getReference().getID());
// Lookup method on service object
Class[] svcClasses = getClassesForService(service, (String[]) registration.getProperty(org.eclipse.ecf.remoteservice.Constants.OBJECTCLASS));
if (svcClasses == null || svcClasses.length == 0)
// $NON-NLS-1$
throw new NullPointerException("Service interface not found for registration=" + registration.getReference().getID());
Method method = getMethodForService(call.getMethod(), svcClasses);
if (method == null)
// $NON-NLS-1$ //$NON-NLS-2$
throw new NullPointerException("Method " + call.getMethod() + " not found for registration=" + registration.getReference().getID());
return method.invoke(service, call.getParameters());
} catch (Exception e) {
// $NON-NLS-1$
throw new ECFException("Exception invoking local service registration=" + registration.getReference().getID(), e);
}
}
use of org.eclipse.ecf.core.util.ECFException in project ecf by eclipse.
the class MultiRosterView method selectAndJoinChatRoomForAccounts.
private void selectAndJoinChatRoomForAccounts(MultiRosterAccount[] accounts) {
// Create chat room selection dialog with managers, open
ChatRoomSelectionDialog dialog = new ChatRoomSelectionDialog(getViewSite().getShell(), accounts);
dialog.open();
// If selection cancelled then simply return
if (dialog.getReturnCode() != Window.OK)
return;
// Get selected room, selected manager, and selected IChatRoomInfo
IChatRoomInfo selectedInfo = dialog.getSelectedRoom().getRoomInfo();
MultiRosterAccount account = dialog.getSelectedRoom().getAccount();
// Now get the secondary ID from the selected room id
final IContainer container = account.getContainer();
final ID connectedID = container.getConnectedID();
if (connectedID == null) {
MessageDialog.openError(getViewSite().getShell(), Messages.MultiRosterView_NO_IDENTIFIER_FOR_ROOM_TITLE, NLS.bind(Messages.MultiRosterView_NO_IDENTIFIER_FOR_ROOM_MESSAGE, selectedInfo.getRoomID()));
return;
}
try {
joinChatRoom(container, selectedInfo, null);
} catch (ECFException e) {
Throwable e1 = e.getStatus().getException();
Activator.getDefault().getLog().log(new Status(IStatus.ERROR, Activator.PLUGIN_ID, IStatus.ERROR, Messages.MultiRosterView_EXCEPTION_LOG_JOIN_ROOM, e1));
ContainerConnectErrorDialog ed = new ContainerConnectErrorDialog(getViewSite().getShell(), selectedInfo.getRoomID().getName(), e1);
ed.open();
}
}
use of org.eclipse.ecf.core.util.ECFException in project ecf by eclipse.
the class ScreenCaptureShareRosterContributionItem method createActionAdd.
private IAction[] createActionAdd(final ID containerID, final IChannelContainerAdapter channelAdapter) {
final IAction action = new Action() {
public void run() {
try {
ScreenCaptureShare.addScreenCaptureShare(containerID, channelAdapter);
} catch (ECFException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
};
action.setText(Messages.ScreenCaptureShareRosterContributionItem_SCREENCAPTURESHARE_LISTENER_MENU_ADD_TEXT);
action.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_DEF_VIEW));
return new IAction[] { action };
}
Aggregations