[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
- <!--x-content-type: text/plain -->
- <!--x-date: Sun May 23 15:25:01 2004 -->
- <!--x-from-r13: psbjyre ng bhgcbfgfragvary.pbz (Quevfgbcure Tbjyre) -->
- <!--x-message-id: [email protected] -->
- <!--x-reference: [email protected] --> "http://www.w3.org/TR/html4/loose.dtd">
- <!--x-subject: [ale] Crazy Perl + Java question -->
- <li><em>date</em>: Sun May 23 15:25:01 2004</li>
- <li><em>from</em>: cfowler at outpostsentinel.com (Christopher Fowler)</li>
- <li><em>in-reply-to</em>: <<a href="msg00914.html">[email protected]</a>></li>
- <li><em>references</em>: <<a href="msg00914.html">[email protected]</a>></li>
- <li><em>subject</em>: [ale] Crazy Perl + Java question</li>
I created an interface that used Getopt to allow the user to pass all
arguments needed to create a JD object. I then added a -e (exec)
options that allowed the user to pass the method and arguments for that
class that needed to be executed.
In this example I called up my remote JCD server and asked it for the
console buffer contents of my Soalris 9 machine.
./jcd.pl -u ensign -p password -s 192.168.2.231 -S -e
"get_buffer('Solaris')"
What I got back was:
sol9 console login: root
Password:
May 21 14:28:38 sol9 login: ROOT LOGIN /dev/console
Last login: Thu May 20 23:53:11 on console
Sun Microsystems Inc. SunOS 5.9 Generic May 2002
# passwd
passwd: Changing password for root
New Password:
Re-enter new Password:
passwd(SYSTEM): They don't match.
Please try again
New Password:
Re-enter new Password:
passwd: password successfully changed for root
# ^D
sol9 console login:
sol9 console login:
sol9 console login:
The beauty of this is that the '-S' switched used SSL as the connection
and I did not have to waste my times with the problems of java not
allowing a connection to a remote site that did not have a signed cert.
Unless there is a way to call perl code directly from Java I think this
would be the best way. I guess I could write a JNI interface that can
return Java objects but that might be a royal PITA.
On Sun, 2004-05-23 at 15:00, Christopher Fowler wrote:
> I was on my way to Home Depot to by some shelving for my ever growing
> collection of technical manuals. I purchased about 10 books in the last
> 2 weeks. I'm running out of space in my home office for all this
> storage. Back on subject.... I was thinking about some classes that I
> need to write in Java to use in our J2EE app that I've written in Perl.
> I would like to know if there is any way to reuse that perl code so I do
> not have to write more in Java?
>
> All of the data that is returned are Strings. I could create a simple
> command line interface to the perl class and have Java execute it in a
> process thread. Is that a crazy idea? Is there a better more efficient
> way?
>
> Chris
>
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> <a rel="nofollow" href="http://www.ale.org/mailman/listinfo/ale">http://www.ale.org/mailman/listinfo/ale</a>
</pre>
<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<hr>
<ul><li><strong>Follow-Ups</strong>:
<ul>
<li><strong><a name="00916" href="msg00916.html">[ale] Crazy Perl + Java question</a></strong>
<ul><li><em>From:</em> cfowler at outpostsentinel.com (Christopher Fowler)</li></ul></li>
</ul></li></ul>
<!--X-Follow-Ups-End-->
<!--X-References-->
<ul><li><strong>References</strong>:
<ul>
<li><strong><a name="00914" href="msg00914.html">[ale] Crazy Perl + Java question</a></strong>
<ul><li><em>From:</em> cfowler at outpostsentinel.com (Christopher Fowler)</li></ul></li>
</ul></li></ul>
<!--X-References-End-->
<!--X-BotPNI-->
<ul>
<li>Prev by Date:
<strong><a href="msg00914.html">[ale] Crazy Perl + Java question</a></strong>
</li>
<li>Next by Date:
<strong><a href="msg00916.html">[ale] Crazy Perl + Java question</a></strong>
</li>
<li>Previous by thread:
<strong><a href="msg00914.html">[ale] Crazy Perl + Java question</a></strong>
</li>
<li>Next by thread:
<strong><a href="msg00916.html">[ale] Crazy Perl + Java question</a></strong>
</li>
<li>Index(es):
<ul>
<li><a href="maillist.html#00915"><strong>Date</strong></a></li>
<li><a href="threads.html#00915"><strong>Thread</strong></a></li>
</ul>
</li>
</ul>
<!--X-BotPNI-End-->
<!--X-User-Footer-->
<!--X-User-Footer-End-->
</body>
</html>