Uri threw out a new idea : have the seperator one of a set. IE
kernel:session:event and kernel/session/event are equivalent. This has
some good points.
Ideally, I would want kernel names to be valid IKC sockets. Ie host:port
and /path/to/unix/domain/socket (eeep!)
Uri wants :: to be valid w/in a cell (aka session) name.
Below is some code I wrote after the last discussion. LOCAL and CURRENT
are just place holders.
We need a solution.... *sigh*
-Philip
#!/usr/bin/perl -w
use strict;
use Data::Dumper;
$Data::Dumper::Indent=1;
foreach my $q (qw(
kernel/session/event kernel// session/ session/event event
poe://kernel/session/event poe:/session/event poe:/event
jaas:kernel/object/method jaas:object/method jaas:method
stem:hub/cell/target
)) {
print Data::Dumper->Dump([parse($q)], [$q]);
}
sub parse
{
my($name)=@_;
my $ret={};
my @names=qw(event session kernel);
if($name=~s(poe://?)()) {
$ret->{ikc}=1;
} elsif($name=~s(stem:)()) {
$ret->{stem}=1;
@names=qw(target cell hub);
} elsif($name=~s(jaas:)()) {
$ret->{jaas}=1;
@names=qw(method object kernel);
}
my @foo=reverse split '/', $name, 3;
$foo[1]||='CURRENT' if @foo[0];
$foo[2]||='LOCAL';
@{$ret}{@names}=@foo;
foreach my $n (@names) {
delete $ret->{$n} unless $ret->{$n};
}
return $ret;
}