1 / 10

Code Generation

Code Generation. Lightning talk 22 July 2004. Morgan Stanley Infrastructure APIs. Talk SOAP to services Authentication Resource discovery Notification (Outage, Metric, Alerts, etc.) Message broadcasting Lots of languages Perl Java C/C++ C#. MSDW::Eclipse - authentication.

Télécharger la présentation

Code Generation

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Code Generation Lightning talk 22 July 2004

  2. Morgan Stanley Infrastructure APIs • Talk SOAP to services • Authentication • Resource discovery • Notification (Outage, Metric, Alerts, etc.) • Message broadcasting • Lots of languages • Perl • Java • C/C++ • C#

  3. MSDW::Eclipse - authentication my $e3client = new MSDW::Eclipse ( 'Hostname' => 'cwit315', 'Port' => '9368', ) || die … $e3client->createUser(User =>'goofie'); sub AUTOLOAD { my ($self) = shift @_; my $command = $AUTOLOAD; $command =~ s/.*:://; die "Not a MSDW::Eclipse method: [$AUTOLOAD]\n" unless $command =~ m/(create|delete|update|report|query)(.*)/; $self->_command($command, @_); } use XML::LibXML; use MSDW::Eclipse::Constants; use vars qw(@fields @members @attribs); use constant ELEMENTS => { 'User' => { 'Attribs' => ['name'], }, Application: Eclipse.pm: Object.pm:

  4. MSDW::Eclipse - authentication Object.pm: 'Domain' => { 'Fields' => [qw(Description Contact Project DefinitionURL)], 'Attribs' => ['name'], }, 'DomainToDomain' => { 'Members' => [qw(Domain LinkTo)], }, 'Resource' => { 'Fields' => [qw(*)], 'Attribs' => ['type'], }, 'Action' => { 'Fields' => [qw(Description)], 'Attribs' => ['name'], }, 'ActionGroup' => { 'Fields' => [qw(Description)], 'Attribs' => ['name'], }, 'ActionToActionGroup' => { 'Members' => [qw(ActionGroup Action )], },

  5. MSDW::Quasar – common alert <class name="CAMMetric" base="BaseEvent" ctor="true" > <message event="CAMMetricTemplate" /> <documentation> <interface>This is the generic class for representing performance metrics. Metrics can either be published directly by the application or automatically by configuring the Quasar publisher to publish metrics from the underlying libraries. Further information on the automatic publishing of metrics can be found in the QUasar user guide. </interface> <implementation>This class is an HDOM implementation of the standard metric interface. </implementation> </documentation> <insertPoint base="CAMMetricMetricDataXpath" /> <optField name="startTimeAsSeconds" class="seconds"> <bind-xml name="CAMMetricStartTimeSecondsXpath" type="long" access="both" /> <documentation> <interface>The start time for the metric. The time is measured as the difference in seconds between the current time and midnight, January 1, 1970 UTC. Alternatively the time can be given as ISO string. </interface> </documentation> </optField> XML:

  6. MSDW::Quasar – common alert package MSDW::Quasar::<xsl:value-of select="./@name" />; use strict; use vars qw(@ISA); @ISA = qw(MSDW::Quasar::<xsl:value-of select="$baseclass" />); use MSDW::Quasar::CAMGeneratedConstants; =head1 NAME MSDW::Quasar::<xsl:value-of select="./@name" /> - module to model <xsl:value-of select="./@name" /> object =head1 SYNOPSIS use MSDW::Quasar; my $<xsl:value-of select="./@name" /> = MSDW::Quasar::<xsl:value-of select="./@name" />::-&gt;new; =head1 DESCRIPTION <xsl:value-of select="./documentation/interface"/> XSL:

  7. MSDW::Quasar – common alert XSL: <xsl:variable name="getter"> =pod my $result = $<xsl:value-of select="../@name" />->get<xsl:value-of select="$fieldname" /><xsl:text>; </xsl:text> =cut sub<xsl:text> </xsl:text>get<xsl:value-of select="$fieldname" /> { my ($self) = @_; my $xpath = <xsl:value-of select="$getParentInsertPoint" /> . <xsl:value-of select="./bind-xml/@name" />(); <xsl:value-of select="$gettype" /> } </xsl:variable>

  8. MSDW::Quasar – common alert XSL: <xsl:variable name="setter"> =pod $<xsl:value-of select="../@name" />->set<xsl:value-of select="$fieldname" />($value)<xsl:text>; </xsl:text> =cut sub<xsl:text> </xsl:text>set<xsl:value-of select="$fieldname" /> { my ($self, $value) = @_; my $xpath = <xsl:value-of select="$getParentInsertPoint" /> . <xsl:value-of select="./bind-xml/@name" />(); <xsl:value-of select="$settype" /> } </xsl:variable>

  9. MSDW::Quasar – common alert package MSDW::Quasar::CAMMetric; use strict; use vars qw(@ISA); @ISA = qw(MSDW::Quasar::CAMEvent); use MSDW::Quasar::CAMGeneratedConstants; =head1 NAME MSDW::Quasar::CAMMetric - module to model CAMMetric object =head1 SYNOPSIS use MSDW::Quasar; my $CAMMetric = MSDW::Quasar::CAMMetric::->new; =head1 DESCRIPTION This is the generic class for representing performance metrics. Metrics can either be published directly by the application or automatically by configuring the Quasar publisher to publish metrics from the underlying libraries. Further information on the automatic publishing of metrics can be found in the QUasar user guide. Perl:

  10. MSDW::Quasar – common alert Perl: =pod B<StartTimeAsMillis> The start time for the metric. The time is measured as the difference in milliseconds between the current time and midnight, January 1, 1970 UTC. Alternatively the time can be given as ISO string. =cut =pod my $result = $CAMMetric->getStartTimeAsMillis; =cut sub getStartTimeAsMillis { my ($self) = @_; my $xpath = __PACKAGE__->_getParentInsertPoint . CAMMetricStartTimeMillisXpath(); return $self->getElementValue($xpath); }

More Related