eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'WrappedMethod':

Home

Documentation
www.exept.de
Everywhere
for:
[back]

Class: WrappedMethod


Inheritance:

   Object
   |
   +--ExecutableFunction
      |
      +--CompiledCode
         |
         +--Method
            |
            +--WrappedMethod

Package:
stx:libbasic3
Category:
Kernel-Methods
Version:
rev: 1.62 date: 2024/03/14 16:21:21
user: cg
file: WrappedMethod.st directory: libbasic3
module: stx stc-classLibrary: libbasic3

Description:


support for MessageTracer

notice: remembers wrappers in a weak classvar, because finding the wrapper for a
method is required for single stepping, and used to take a long time when using allInstances.
Therefore, wrappers are remembered.

copyright

COPYRIGHT (c) 1994 by Claus Gittinger All Rights Reserved This software is furnished under a license and may be used only in accordance with the terms of that license and with the inclusion of the above copyright notice. This software may not be provided or otherwise made available to, or used by, any other person. No title to or ownership of the software is hereby transferred.

Class protocol:

registration
o  allInstancesDo: aBlock
(comment from inherited method)
evaluate aBlock for all of my instances

o  allWrappedMethods
must eliminate dead entries - as this is a weak set, it gets cleaned up with a delay.

Usage example(s):

     self allWrappedMethods

o  allWrappedMethodsDo: aBlock

o  register: aWrappedMethod

o  unregister: aWrappedMethod


Instance protocol:

accessing
o  basicLiterals
return my literals

o  category: newCategory
(comment from inherited method)
set the method's category

o  literals
return the wrapped method's literals

o  literalsDetect: aBlock ifNone: exceptionBlock
access the wrapped method's literals

o  literalsDo: aBlock
access the wrapped method's literals

o  methodArgAndVarNames
return the names of the args and locals of the wrapped method.

o  methodArgAndVarNamesInContext: context
return the names of the args and locals of the wrapped method.
in given context (for Java, as in java local names differ by
actual program counter)

o  methodVarNames
return the names of the locals of the wrapped method.

o  numVars
return the number of locals in the wrapped method.

o  originalMethod
return the method the receiver is wrapping

o  originalMethodIfWrapped
return the method the receiver is wrapping

o  package: aSymbol
(comment from inherited method)
set the package-symbol

o  privacy
return the wrapped method's privacy

o  privacy: aSymbol
set the wrapped method's privacy

o  programmingLanguage

o  replaceOriginalMethodWith: aNewMethod
change the original method which is going to be invoked by this wrapper.
The only place where this makes sense is when the original method has to be
replaced by a recompiled breakpointed method (in the debugger).

o  restricted: aBoolean
(comment from inherited method)
set or clear the flag bit stating that this method is restricted.
Execution of the receiver will only be allowed if the system is not in
'trap restricted mode' (-->ObjectMemory) otherise a runtime
error (PrivateMethodSignal) is raised.

Notice: method restriction is a nonstandard feature, not supported
by other smalltalk implementations and not specified in the ANSI spec.

This is EXPERIMENTAL - and being evaluated for usability.
It may change or even vanish (if it shows to be not useful).

o  setPrivacy: aSymbol
set the wrapped method's privacy

o  shadowedMethod
return true, if this method is an extension (i.e. package ~= classes' package)
which shadows an existing method from another package (i.e. a package conflict)

o  source
return the source of the method

o  sourceFilename
return the sourcefilename if source is extern; nil otherwise

o  sourcePosition
return the sourceposition if source is extern; nil otherwise

accessing-annotations
o  annotateWith: annotation
add a (hidden) annotation

o  annotationAt: key
(comment from inherited method)
(Object >> #yourself) annotationAt: #namespace:
(WindowsAutomation2::Client >> #stopRecording) annotationAt: #foreignSelectors:

o  annotations
return the wrapped method's annotations

o  annotations: anObject
(comment from inherited method)
set the annotations

o  annotationsAt: key

o  annotationsAt: key1 orAt: key2

o  annotationsAt: key1 orAt: key2 do: block

o  annotationsDo: aBlock

misc
o  makeLocalStringSource
(comment from inherited method)
assure that the method's source code is stored locally as a string
within the method (as opposed to an external string, which is accessed
by reading the source code file).
This is required, when a method's package is changed, to assure that its
sourceCode is not lost.

o  register

o  unregister

printing & storing
o  printOn: aStream
put a printed representation of the receiver onto aStream.
Since methods do not store their class/selector, we have to search
for it here.

o  selectorPrintStringInBrowserFor: selector

o  selectorPrintStringInBrowserFor: selector class: class
(comment from inherited method)
nsPart := selector copyFrom:2 to:idx-1.
ns := Smalltalk at:nsPart asSymbol.

private
o  annotationAtIndex: index
return annotation at given index.
any raw annotation array is lazily initialized

o  annotationIndexOf: key
Returns index of annotation with given key
or nil if there is no such annotation

queries
o  argSignature

o  hasAnnotation
Return true iff the method has any annotation

o  hasResource
return the wrapped methods hasResource

o  isBreakpointed
return true, if the receiver is a wrapped method for a breakpoint.
Ask the messageTracer, since I don't know if it's a break or trace

o  isMocked
Return true, if the method has been mocked (by means of MessageTracer>>mockMethod:do:

o  isTimed
return true, if the receiver is a wrapped method for a time measurement.
Ask the messageTracer, since I don't know if it's a break or trace

o  isTraced
return true, if the receiver is a wrapped method for a trace point.
Ask the messageTracer, since I don't know if it's a break or trace

o  isWrapped
return true, if the receiver is a wrapped method.
True is returned here, since the receiver is always a wrapped one

o  messagesSent
return a set-like collection with the message selectors sent by the receiver.
Uses Parser to parse method's source and extract the names.
The returned collection includes all used message selectors
(i.e. including super-send messages)

o  messagesSentToSelf
return a collection of message selectors sent to self by this method

o  messagesSentToSuper
return a collection of message selectors sent to super by this method

o  parse: parseSelector with: arg2 return: accessSelector or: valueIfNoSource
(comment from inherited method)
helper for methodArgNames, methodVarNames etc.
Get the source, let parser parse it using parseSelector,
return parser-info using accessSelector

o  refersToLiteral: anObject
(comment from inherited method)
redefined to also search in annotations

o  resources
return the wrapped methods resources

o  sendsAnySelector: aCollection
(comment from inherited method)
return true, if this method contains a message-send
to any of aCollectionOfSelectorSymbols.

o  signature

o  signatureNameWithoutReturnType



ST/X 7.7.0.0; WebServer 1.702 at 20f6060372b9.unknown:8081; Tue, 10 Dec 2024 07:34:47 GMT