Permalink
Browse files

[RT 44466] remove corba-related scripts, now obsolete

  • Loading branch information...
1 parent 4774e1f commit 98d2a0fed2d9b7e7437b15abc6bd829b32afe777 Chris Fields committed Jul 23, 2010
Showing with 0 additions and 224 deletions.
  1. +0 −65 scripts/corba/bioenv_server.pl
  2. +0 −105 scripts/corba/caching_corba_server.pl
  3. +0 −54 scripts/corba/test_bioenv.pl
View
65 scripts/corba/bioenv_server.pl
@@ -1,65 +0,0 @@
-#!/usr/local/lib/perl
-
-use Bio::CorbaServer::BioEnv;
-use CORBA::ORBit idl => [ 'biocorba.idl' ];
-use Bio::DB::BioSQL::DBAdaptor;
-use Getopt::Long;
-
-my $host = "localhost";
-my $sqlname = "bioperl";
-my $dbuser = "root";
-my $dbpass = undef;
-my $format = 'fasta';
-
-&GetOptions( 'host:s' => \$host,
- 'sqldb:s' => \$sqlname,
- 'dbuser:s' => \$dbuser,
- 'dbpass:s' => \$dbpass,
- 'format:s' => \$format,
- );
-
-$dbadaptor = Bio::DB::BioSQL::DBAdaptor->new( -host => $host,
- -dbname => $sqlname,
- -user => $dbuser,
- -pass => $dbpass
- );
-
-
-
-#build the actual orb and get the first POA (Portable Object Adaptor)
-my $orb = CORBA::ORB_init("orbit-local-orb");
-my $root_poa = $orb->resolve_initial_references("RootPOA");
-my $servant = Bio::CorbaServer::BioEnv->new('-poa' => $root_poa,
- '-no_destroy' => 1);
-
-
-$biodb = $dbadaptor->get_BioDatabaseAdaptor;
-
-foreach $name ( $biodb->list_biodatabase_names ) {
- $bioseqdb = $biodb->fetch_BioSeqDatabase_by_name($name);
- $servant->add_SeqDB($name,"unknown-version",$bioseqdb);
-}
-
-
-# this registers this object as a live object with the ORB
-my $id = $root_poa->activate_object ($servant);
-
-
-# we need to get the IOR of this object. The way to do this is to
-# to get a client of the object (temp) and then get the IOR of the
-# client
-$temp = $root_poa->id_to_reference ($id);
-my $ior = $orb->object_to_string ($temp);
-
-# write out the IOR. This is what we give to a different machine
-$ior_file = "bioenv.ior";
-open (OUT, ">$ior_file") || die "Cannot open file for ior: $!";
-print OUT "$ior";
-close OUT;
-
-# tell everyone we are ready for it
-print STDERR "Activating the ORB. IOR written to bioenv.ior\n";
-
-# and off we go. Woo Hoo!
-$root_poa->_get_the_POAManager->activate;
-$orb->run;
View
105 scripts/corba/caching_corba_server.pl
@@ -1,105 +0,0 @@
-#!/usr/local/lib/perl
-
-use Bio::CorbaServer::BioEnv;
-use Bio::CorbaClient::SeqDB;
-use Bio::DB::CacheServer::SeqDB;
-use Bio::DB::BioSQL::DBAdaptor;
-
-
-use CORBA::ORBit idl => [ 'biocorba.idl' ];
-use Getopt::Long;
-
-my $host = "localhost";
-my $sqlname = "bioperlcache";
-my $dbuser = "root";
-my $dbpass = undef;
-my $format = 'fasta';
-my $dbname = undef;
-
-&GetOptions( 'host:s' => \$host,
- 'sqldb:s' => \$sqlname,
- 'dbuser:s' => \$dbuser,
- 'dbpass:s' => \$dbpass,
- 'format:s' => \$format,
- 'dbname:s' => \$dbname,
- 'iorfile:s' => \$iorfile
- );
-
-if( !defined $dbname) {
- die "Must specify the dbname to cache\n";
-}
-
-
-# build the ORB
-
-my $orb = CORBA::ORB_init("orbit-local-orb");
-my $root_poa = $orb->resolve_initial_references("RootPOA");
-
-# get the corba object of our remote server
-
-open(F,"$iorfile") || die "Could not open $iorfile";
-$ior = <F>;
-chomp $ior;
-close(F);
-
-my $remote = $orb->string_to_object($ior);
-my $corba_ref = $remote->get_SeqDB_by_name($dbname);
-
-if( !defined $corba_ref ) {
- die "No remote database for $dbname";
-}
-
-# bind the corba object as Bioperl Client
-
-my $read = Bio::CorbaClient::SeqDB->new( -corbaref => $corba_ref);
-
-
-# connect to our local database. This will throw on inability to connect
-
-$dbadaptor = Bio::DB::BioSQL::DBAdaptor->new( -host => $host,
- -dbname => $sqlname,
- -user => $dbuser,
- -pass => $dbpass
- );
-
-
-# build a caching server
-
-my $cache = Bio::DB::CacheServer::SeqDB->new( -read_db => $read,
- -write_dbadaptor => $dbadaptor,
- -dbname => $dbname);
-
-
-# bind cache to a servant object
-
-my $servant = Bio::CorbaServer::BioEnv->new('-poa' => $root_poa,
- '-no_destroy' => 1);
-
-
-$servant->add_SeqDB($dbname,"unknown-version",$cache);
-
-# Read to rock and roll
-
-# this registers this object as a live object with the ORB
-my $id = $root_poa->activate_object ($servant);
-
-
-# we need to get the IOR of this object. The way to do this is to
-# to get a client of the object (temp) and then get the IOR of the
-# client
-$temp = $root_poa->id_to_reference ($id);
-my $ior = $orb->object_to_string ($temp);
-
-# write out the IOR. This is what we give to a different machine
-$out_file = "cache.ior";
-open (OUT, ">$out_file") || die "Cannot open file for ior: $!";
-print OUT "$ior";
-close OUT;
-
-# tell everyone we are ready for it
-print STDERR "Activating the ORB. IOR written to $out_file\n";
-
-# and off we go. Woo Hoo!
-$root_poa->_get_the_POAManager->activate;
-$orb->run;
-
View
54 scripts/corba/test_bioenv.pl
@@ -1,54 +0,0 @@
-#!/usr/local/bin/perl -w
-
-$ior_file = shift;
-
-use CORBA::ORBit idl => [ 'biocorba.idl' ];
-
-$ior_file ||= "bioenv.ior";
-$orb = CORBA::ORB_init("orbit-local-orb");
-
-open(F,"$ior_file") || die "Could not open $ior_file";
-$ior = <F>;
-chomp $ior;
-close(F);
-
-$bioenv = $orb->string_to_object($ior);
-
-
-$names = $bioenv->get_SeqDB_names();
-
-foreach $name ( @$names ) {
- print "Got sequence db $name\n";
-}
-
-$name = shift @$names;
-
-$db = $bioenv->get_SeqDB_by_name($name,0);
-
-$names = $db->accession_numbers();
-
-foreach my $n ( @$names ) {
- print STDERR "Got $n\n";
- $seq = $db->get_Seq($n,0);
- print STDERR "Got $seq ",$seq->display_id," and ",$seq->subseq(1,10),"\n";
- $vec = $seq->all_SeqFeatures(0);
- $it = $vec->iterator();
-
- while( $it->has_more ) {
- $f = $it->next();
- print STDERR "Has feature ",$f->start," ",$f->end," ",$f->type," ",$f->source,"\n";
- $f->unref();
- }
-
- $seq->unref();
-}
-
-
-
-
-
-
-
-
-
-

0 comments on commit 98d2a0f

Please sign in to comment.