<?xml version="1.0" encoding="UTF-8"?>
	<rss version="2.0"
		xmlns:content="http://purl.org/rss/1.0/modules/content/"
		xmlns:wfw="http://wellformedweb.org/CommentAPI/"
		xmlns:dc="http://purl.org/dc/elements/1.1/"
		xmlns:atom="http://www.w3.org/2005/Atom"

			>

	<channel>
		<title>Cycling 74  &#187;  Topic: Instantiating Java Externals</title>
		<atom:link href="http://cycling74.com/forums/topic/instantiating-java-externals/feed" rel="self" type="application/rss+xml" />
		<link>http://cycling74.com/forums/topic/instantiating-java-externals/feed</link>
		<description></description>
		<pubDate>Tue, 18 Jun 2013 00:56:12 +0000</pubDate>
		<generator>http://bbpress.org/?v=2.2.4</generator>
		<language></language>

		
														
					
				<item>
					<guid>http://cycling74.com/forums/topic/instantiating-java-externals/#post-49597</guid>
					<title><![CDATA[Instantiating Java Externals]]></title>
					<link>http://cycling74.com/forums/topic/instantiating-java-externals/#post-49597</link>
					<pubDate>Wed, 07 Apr 2010 03:26:40 +0000</pubDate>
					<dc:creator>Samurai413x</dc:creator>

					<description>
						<![CDATA[
						<p>I&#8217;m worried I might have a fundamental misunderstanding of the capacities of Java externals.</p>
<p>I think it boils down to one question. Is it possible to instantiate a Java external from another Java class?</p>
<p>I am trying to create an external called JavaToMax that simply sends messages from Java out to Max.  The problem is I want/need those messages to be triggered from the Java side; my Java classes need to be able to send messages to Max whenever they want.</p>
<p>Is this doable?  I am under the impression that it is not, since even if you could instantiate and object from Java, there would be no way of identifying WHICH object it is in the patch.  Can anyone think of a workaround?  If not, I am thinking of switching to OSC.</p>
<p>I&#8217;ll include code, not sure how helpful it will be.  Ignore the commented stuff and make sure you change the package name.</p>
<p>
<div><span id="toggle49597-0" class="patchtoggle" onmousedown="toggleMaxPatch('post49597-0', 'er49597-0');">&#8211; Pasted Max <span id="maxversion49597-0"></span> Patch, click to <span id="er49597-0">expand</span>. &#8211;</span> <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"  width="110" height="14" class="clippy" ><param name="allowScriptAccess" value="always" /><param name="quality" value="high" /><param name="scale" value="noscale" /><param NAME="FlashVars" value="copied=copied!&#038;copyto=copy to clipboard"/><param name="bgcolor" value="#FFFFFF"/><param name="wmode" value="opaque"/><embed src="/wp-content/plugins/bbpress-copy-compressed/clippy.swf"  width="110" height="14"   name="clippy"  quality="high"  allowScriptAccess="always"  type="application/x-shockwave-flash"  pluginspage="http://www.macromedia.com/go/getflashplayer"  FlashVars="text=----------begin_max5_patcher----------%0A324.3ocsS9zSDBCDE%2Bb2j86PSOianvpQ8lWMwadyrwTf5RWgVBLrx5F%2Bta6.%0Ar%2BwUbIQ8.LIu4Q4M%2BlzsSmPXQlFYEidK8IJgr0pPPMmBoWfvxEMwYhJzHKpF%0A.il400SWmqzYR.ax6UUInWSzpKlenUSMbh2VMXSgrMHrHgdIitnueg.hSU5k%0AOWJigVKAWd8LeOJOLvUB76eSWfeyGSm3p1h2nGKs7MaZ2kUP1f%2BKVdyJJjJq%0AdciHxrVN6dwZwilGDM6r9hQCZQNld1ckJQ13gS3.vI3vCuR8Nd3b2zNDzXd1%0Amy.MjS7aBwxUy%2BGoVQoRC%2BIDhO.g7OGg9VBfidGHBGF.sbjkozmb6.OVWiuf%0AkJScYb%2Bxna0R82uPRjUfRK.k8tydS7iMkpRRj5iFubURgwBytb7S6pQGs4iI%0AZg%2B5n4DrkOQG4me0%0A-----------end_max5_patcher-----------&#038;copied=copied!&#038;;copyto=copy to clipboard"  bgcolor="#ffffff"  wmode="opaque" /> </object></div>
<div id="post49597-0" style="display:none;visibility:hidden;" >
<div class="patchtoggleInfo"><small>Copy <b>all</b> of the following text.Then, in Max, select <em>New From Clipboard</em>.</small></div>
<div class="patchtogglediv">
<pre><code id="pastedcode49597-0">----------begin_max5_patcher----------
324.3ocsS9zSDBCDE+b2j86PSOianvpQ8lWMwadyrwTf5RWgVBLrx5F+ta6.
r+wUbIQ8.LIu4Q4M+lzsSmPXQlFYEidK8IJgr0pPPMmBoWfvxEMwYhJzHKpF
.il400SWmqzYR.ax6UUInWSzpKlenUSMbh2VMXSgrMHrHgdIitnueg.hSU5k
OWJigVKAWd8LeOJOLvUB76eSWfeyGSm3p1h2nGKs7MaZ2kUP1f+KVdyJJjJq
dciHxrVN6dwZwilGDM6r9hQCZQNld1ckJQ13gS3.vI3vCuR8Nd3b2zNDzXd1
my.MjS7aBwxUy+GoVQoRC+IDhO.g7OGg9VBfidGHBGF.sbjkozmb6.OVWiuf
kJScYb+xna0R82uPRjUfRK.k8tydS7iMkpRRj5iFubURgwBytb7S6pQGs4iI
Zg+5n4DrkOQG4me0
-----------end_max5_patcher-----------</code></pre></div>
</div>
</p><p>Thanks!</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/instantiating-java-externals/#post-178207</guid>
					<title><![CDATA[Re: Instantiating Java Externals]]></title>
					<link>http://cycling74.com/forums/topic/instantiating-java-externals/#post-178207</link>
					<pubDate>Wed, 07 Apr 2010 06:54:37 +0000</pubDate>
					<dc:creator>Jesse</dc:creator>

					<description>
						<![CDATA[
						<p>Java objects hosted within Max can send messages directly into Max.  If you are working in another context (i.e. a Java application) then you&#8217;ll have to try another route &#8211;  OSC or just plain UDP will work fine.</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/instantiating-java-externals/#post-178208</guid>
					<title><![CDATA[Re: Instantiating Java Externals]]></title>
					<link>http://cycling74.com/forums/topic/instantiating-java-externals/#post-178208</link>
					<pubDate>Sat, 10 Apr 2010 13:05:50 +0000</pubDate>
					<dc:creator>Hans Höglund</dc:creator>

					<description>
						<![CDATA[
						<p>You can store instances of MaxObjects in a static field, then write static methods that send messages to them.</p>
<p>Writing from memory, it should look something like this.</p>
<pre><code>public class MaxReceiver extends MaxObject {

    static List<maxreceiver> instances = new ArrayList</maxreceiver><maxreceiver>();

    public MaxReceiver {
        declareOutlets(DataTypes.ALL)
        instances.add(this);
    }

    protected void receive(Atom... message) {
        outlet(0, message);
    }

    public static void send(Atom... message) {
        for (MaxReceiver r : instances) {
            r.receive(message);
        }
    }
}</maxreceiver></code></pre><p>Above, the send messages sends the given message throught the outlet of all MaxReceiver objects. Alternatively, you could let the users supply a name argument to each MaxReceiver object and provide a <code>public static void send (String name, Atom... message)</code> method.</p>
						]]>
					</description>

					
					
				</item>

					
		
	</channel>
	</rss>

