X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.utils.thread%2Fsrc%2Forg%2Fsimantics%2Futils%2Fthreads%2Ftest%2FExampleObject.java;h=a0c1d75873408d0f6ed0cc3c50f5a74077524cae;hp=40fdedf08071249f7bff9a40dc101ef8a4279c75;hb=0ae2b770234dfc3cbb18bd38f324125cf0faca07;hpb=24e2b34260f219f0d1644ca7a138894980e25b14 diff --git a/bundles/org.simantics.utils.thread/src/org/simantics/utils/threads/test/ExampleObject.java b/bundles/org.simantics.utils.thread/src/org/simantics/utils/threads/test/ExampleObject.java index 40fdedf08..a0c1d7587 100644 --- a/bundles/org.simantics.utils.thread/src/org/simantics/utils/threads/test/ExampleObject.java +++ b/bundles/org.simantics.utils.thread/src/org/simantics/utils/threads/test/ExampleObject.java @@ -1,44 +1,44 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Association for Decentralized Information Management - * in Industry THTH ry. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * VTT Technical Research Centre of Finland - initial API and implementation - *******************************************************************************/ -/* - * - * @author Toni Kalajainen - */ -package org.simantics.utils.threads.test; - -import java.lang.reflect.Method; - -import org.simantics.utils.threads.IThreadWorkQueue; -import org.simantics.utils.threads.SyncListenerList; - - -public class ExampleObject { - - SyncListenerList listeners = new SyncListenerList(ExampleListener.class); - - public void addListener(IThreadWorkQueue thread, ExampleListener l) - { - listeners.add(thread, l); - } - - public void removeListener(IThreadWorkQueue thread, ExampleListener l) - { - listeners.remove(thread, l); - } - - static final Method onMessage = SyncListenerList.getMethod(ExampleListener.class, "onMessage"); - public void fireMessage(String message) - { - listeners.fireEventSync(onMessage, this, message); - } - -} +/******************************************************************************* + * Copyright (c) 2007, 2010 Association for Decentralized Information Management + * in Industry THTH ry. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * VTT Technical Research Centre of Finland - initial API and implementation + *******************************************************************************/ +/* + * + * @author Toni Kalajainen + */ +package org.simantics.utils.threads.test; + +import java.lang.reflect.Method; + +import org.simantics.utils.threads.IThreadWorkQueue; +import org.simantics.utils.threads.SyncListenerList; + + +public class ExampleObject { + + SyncListenerList listeners = new SyncListenerList(ExampleListener.class); + + public void addListener(IThreadWorkQueue thread, ExampleListener l) + { + listeners.add(thread, l); + } + + public void removeListener(IThreadWorkQueue thread, ExampleListener l) + { + listeners.remove(thread, l); + } + + static final Method onMessage = SyncListenerList.getMethod(ExampleListener.class, "onMessage"); + public void fireMessage(String message) + { + listeners.fireEventSync(onMessage, this, message); + } + +}